File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ protected function shrink_options($input) {
2828 'Authorization: Basic ' . base64_encode ('api: ' . $ this ->api_key ),
2929 'User-Agent: ' . Tiny_WP_Base::plugin_identification () . ' fopen ' ,
3030 ),
31- 'content ' => $ input
31+ 'content ' => $ input ,
32+ 'follow_location ' => 0 ,
33+ 'max_redirects ' => 1 , // Necessary for PHP 5.2
34+ 'ignore_errors ' => TRUE // Apparently, a 201 is a failure :'(
3235 ),
3336 'ssl ' => array (
3437 'cafile ' => self ::get_ca_file (),
Original file line number Diff line number Diff line change @@ -115,8 +115,8 @@ protected static function decode($text) {
115115 $ result = json_decode ($ text , true );
116116 if ($ result === null ) {
117117 throw new Tiny_Exception (sprintf ('JSON: %s [%d] ' ,
118- PHP_VERSION_ID >= 50500 ? json_last_error_msg () : 'Error ' ,
119- json_last_error ()),
118+ PHP_VERSION_ID >= 50500 ? json_last_error_msg () : 'Unknown error ' ,
119+ PHP_VERSION_ID >= 50300 ? json_last_error () : ' Error ' ),
120120 'JsonError ' );
121121 }
122122 return $ result ;
You can’t perform that action at this time.
0 commit comments