dailymotion/dailymotion-sdk-php — Issue #5: Error uploading file with quotes
Author: sebdesign
Created: 2011-12-08 18:14:52+00:00
State: open

I was trying to upload a video wich had a single quote in the filename.
As a result I received a `DailymotionTransportException` saying *Missing required parameter: url*.

When `$this->uploadFile($filePath)` calls `$this->call('file.upload')` on [line 187](https://github.com/dailymotion/dailymotion-sdk-php/blob/master/Dailymotion.php#L187) the `$result` is a JSON string wich has a `name` property. Its value is the filename but the quote is escaped with a single slash.

On [line 190](https://github.com/dailymotion/dailymotion-sdk-php/blob/master/Dailymotion.php#L190) `json_decode()` returns `NULL`. The quote needs to be unescaped, or escape the flash (double-escape the quote).

Here is a working version:

```php
$result = json_decode(str_replace('\\', '\\\\', $this->httpRequest($result['upload_url'], array('file' => '@' . $filePath))), true);
```