From: Roland Häder Date: Thu, 22 Jan 2015 12:36:26 +0000 (+0100) Subject: Merge branch 'nightly' of gitorious.org:social/mainline into nightly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6db61f72a68a76c32526f9b259e6f1e8e6f2b610;p=quix0rs-gnu-social.git Merge branch 'nightly' of gitorious.org:social/mainline into nightly Conflicts: actions/apiaccountverifycredentials.php actions/apimediaupload.php actions/public.php actions/register.php plugins/OStatus/scripts/update_ostatus_profiles.php plugins/OpportunisticQM/lib/opportunisticqueuemanager.php Signed-off-by: Roland Häder --- 6db61f72a68a76c32526f9b259e6f1e8e6f2b610 diff --cc actions/apiaccountverifycredentials.php index dfa366cbb6,9b98fa6d81..4835a2ca63 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@@ -48,17 -48,9 +48,17 @@@ if (!defined('STATUSNET')) */ class ApiAccountVerifyCredentialsAction extends ApiAuthAction { - protected function handle() + /** + * Handle the request + * + * Check whether the credentials are valid and output the result + * + * @param array $args $_REQUEST data (unused) + * @return void + */ - function handle(array $args=array()) ++ protected function handle(array $args=array()) { - parent::handle(); + parent::handle($args); if (!in_array($this->format, array('xml', 'json'))) { // TRANS: Client error displayed when coming across a non-supported API method. diff --cc actions/apimediaupload.php index 14c26d238f,2d81af157e..a3703fad06 --- a/actions/apimediaupload.php +++ b/actions/apimediaupload.php @@@ -53,18 -53,10 +53,10 @@@ class ApiMediaUploadAction extends ApiA * * @return void */ - function handle(array $args=array()) - protected function handle() ++ protected function handle(array $args=array()) { - parent::handle(); + parent::handle($args); - if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->clientError( - // TRANS: Client error. POST is a HTTP command. It should not be translated. - _('This method requires a POST.'), - 400, $this->format - ); - } - // Workaround for PHP returning empty $_POST and $_FILES when POST // length > post_max_size in php.ini diff --cc actions/public.php index 8e5da47646,52bab072ae..193365309f --- a/actions/public.php +++ b/actions/public.php @@@ -53,9 -53,10 +53,10 @@@ class PublicAction extends Actio var $page = null; var $notice; - var $userProfile = null; + + protected $stream = null; - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } @@@ -115,9 -117,9 +117,9 @@@ * * @return void */ - function handle(array $args=array()) - protected function handle() ++ protected function handle(array $args=array()) { - parent::handle($args); + parent::handle(); $this->showPage(); } diff --cc plugins/OStatus/classes/Ostatus_profile.php index d698ba81a3,2fb869e2f3..4081edadaa --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@@ -1261,12 -1260,17 +1261,17 @@@ class Ostatus_profile extends Managed_D // @todo FIXME: This should be better encapsulated // ripped from oauthstore.php (for old OMB client) - $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar'); + $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar'); try { - if (!copy($url, $temp_filename)) { + $client = new HTTPClient(); + $response = $client->get($url); + + if (!$response->isOk()) { // TRANS: Server exception. %s is a URL. - throw new ServerException(sprintf(_m('Unable to fetch avatar from %s.'), $url)); + throw new ServerException(sprintf(_m('Unable to fetch avatar from %s to %s.'), $url, $temp_filename)); } + // FIXME: make sure it's an image here instead of _after_ writing to a file? + file_put_contents($temp_filename, $response->getBody()); if ($this->isGroup()) { $id = $this->group_id;