Skip to content

Commit

Permalink
Finish 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetx committed Dec 13, 2014
2 parents c767eab + 61115a6 commit 58c58d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
codebird-php - changelog
========================

2.6.1 (2014-12-13)
- #90 Allow uploading media with special chars

2.6.0 (2014-10-12)
+ #67 Don't require cURL, allow stream connections too
+ Use default timeout
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codebird-php",
"version": "2.6.0",
"version": "2.6.1",
"homepage": "http://www.jublo.net/projects/codebird/php",
"authors": [
"Joshua Atkins <[email protected]>",
Expand Down
14 changes: 8 additions & 6 deletions src/codebird.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* A Twitter library in PHP.
*
* @package codebird
* @version 2.6.0
* @version 2.6.1
* @author Jublo Solutions <[email protected]>
* @copyright 2010-2014 Jublo Solutions <[email protected]>
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License 3.0
Expand Down Expand Up @@ -109,7 +109,7 @@ class Codebird
/**
* The current Codebird version
*/
protected $_version = '2.6.0';
protected $_version = '2.6.1';

/**
* Auto-detect cURL absence
Expand Down Expand Up @@ -1091,18 +1091,20 @@ protected function _buildMultipart($method, $params)

// check for filenames
if (in_array($key, $possible_files)) {
// the file system does not know about UTF-8 filenames
$filename_decoded = utf8_decode($value);
if (// is it a file, a readable one?
@file_exists($value)
&& @is_readable($value)
@file_exists($filename_decoded)
&& @is_readable($filename_decoded)

// is it a valid image?
&& $data = @getimagesize($value)
&& $data = @getimagesize($filename_decoded)
) {
// is it a supported image format?
if (in_array($data[2], $this->_supported_media_files)) {
// try to read the file
ob_start();
readfile($value);
readfile($filename_decoded);
$data = ob_get_contents();
ob_end_clean();
if (strlen($data) === 0) {
Expand Down

0 comments on commit 58c58d7

Please sign in to comment.