|
6 | 6 | * A Twitter library in PHP. |
7 | 7 | * |
8 | 8 | * @package codebird |
9 | | - * @version 2.6.0 |
| 9 | + * @version 2.6.1 |
10 | 10 | * @author Jublo Solutions <support@jublo.net> |
11 | 11 | * @copyright 2010-2014 Jublo Solutions <support@jublo.net> |
12 | 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License 3.0 |
@@ -109,7 +109,7 @@ class Codebird |
109 | 109 | /** |
110 | 110 | * The current Codebird version |
111 | 111 | */ |
112 | | - protected $_version = '2.6.0'; |
| 112 | + protected $_version = '2.6.1'; |
113 | 113 |
|
114 | 114 | /** |
115 | 115 | * Auto-detect cURL absence |
@@ -1091,18 +1091,20 @@ protected function _buildMultipart($method, $params) |
1091 | 1091 |
|
1092 | 1092 | // check for filenames |
1093 | 1093 | if (in_array($key, $possible_files)) { |
| 1094 | + // the file system does not know about UTF-8 filenames |
| 1095 | + $filename_decoded = utf8_decode($value); |
1094 | 1096 | if (// is it a file, a readable one? |
1095 | | - @file_exists($value) |
1096 | | - && @is_readable($value) |
| 1097 | + @file_exists($filename_decoded) |
| 1098 | + && @is_readable($filename_decoded) |
1097 | 1099 |
|
1098 | 1100 | // is it a valid image? |
1099 | | - && $data = @getimagesize($value) |
| 1101 | + && $data = @getimagesize($filename_decoded) |
1100 | 1102 | ) { |
1101 | 1103 | // is it a supported image format? |
1102 | 1104 | if (in_array($data[2], $this->_supported_media_files)) { |
1103 | 1105 | // try to read the file |
1104 | 1106 | ob_start(); |
1105 | | - readfile($value); |
| 1107 | + readfile($filename_decoded); |
1106 | 1108 | $data = ob_get_contents(); |
1107 | 1109 | ob_end_clean(); |
1108 | 1110 | if (strlen($data) === 0) { |
|
0 commit comments