]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' of gitorious.org:social/mainline into nightly
authorRoland Haeder <roland@mxchange.org>
Tue, 27 Jan 2015 18:34:41 +0000 (19:34 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 27 Jan 2015 18:34:41 +0000 (19:34 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
Conflicts:
plugins/OStatus/classes/Ostatus_profile.php

1  2 
lib/default.php
lib/util.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/scripts/testfeed.php
plugins/OStatus/scripts/update_ostatus_profiles.php

diff --cc lib/default.php
Simple merge
diff --cc lib/util.php
Simple merge
index 4081edadaa6a7b847580462f5b5c2aabbc64d89d,79098c64048ed31705b54ecfb94259619dad826d..dd02c22009026d651dadb1e83e847948107e0776
@@@ -1261,17 -1259,15 +1260,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 {
-             $client = new HTTPClient();
-             $response = $client->get($url);
+             $imgData = HTTPClient::quickGet($url);
 +
-             if (!$response->isOk()) {
-                 // TRANS: Server exception. %s is a URL.
-                 throw new ServerException(sprintf(_m('Unable to fetch avatar from %s to %s.'), $url, $temp_filename));
+             // Make sure it's at least an image file. ImageFile can do the rest.
+             if (false === getimagesizefromstring($imgData)) {
+                 throw new UnsupportedMediaException(_('Downloaded group avatar was not an image.'));
              }
-             // FIXME: make sure it's an image here instead of _after_ writing to a file?
-             file_put_contents($temp_filename, $response->getBody());
++
+             file_put_contents($temp_filename, $imgData);
+             unset($imgData);    // No need to carry this in memory.
  
              if ($this->isGroup()) {
                  $id = $this->group_id;
Simple merge