]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' of gitorious.org:social/mainline into nightly
authorRoland Haeder <roland@mxchange.org>
Wed, 21 Jan 2015 18:40:47 +0000 (19:40 +0100)
committerRoland Haeder <roland@mxchange.org>
Wed, 21 Jan 2015 18:40:47 +0000 (19:40 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
Conflicts:
actions/apimediaupload.php
actions/register.php
plugins/OStatus/scripts/update_ostatus_profiles.php
plugins/OpportunisticQM/lib/opportunisticqueuemanager.php

1  2 
actions/apimediaupload.php
actions/register.php
lib/action.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/scripts/update_ostatus_profiles.php

index 14c26d238f677f2cb0d92464e9d5613ae2db1655,2d81af157e06362db885ca5f62fb3643babcce7d..a3703fad060f5419afaf6342499210498564d890
@@@ -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
  
Simple merge
diff --cc lib/action.php
Simple merge
index d698ba81a36339c56c315ef9bbb1310d8f157f11,2fb869e2f3bafef92ed4d90666cdb732cbabfe5c..4081edadaa6a7b847580462f5b5c2aabbc64d89d
@@@ -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;