X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountupdateprofileimage.php;h=153ef7818ee03a9f09cc74bb4b790b8392e516bb;hb=83c2e0b379a8a6a81c211ed5c4d837e047f919f7;hp=416fee45acb0b608b3e2a10598f60ea1ddd2953b;hpb=527427d3e0752a371b1b6421dabec5cc1c7e19ad;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountupdateprofileimage.php b/actions/apiaccountupdateprofileimage.php index 416fee45ac..153ef7818e 100644 --- a/actions/apiaccountupdateprofileimage.php +++ b/actions/apiaccountupdateprofileimage.php @@ -87,16 +87,22 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction return; } - if (empty($this->user)) { - $this->clientError(_('No such user!'), 404, $this->format); + // Workaround for PHP returning empty $_POST and $_FILES when POST + // length > post_max_size in php.ini + + if (empty($_FILES) + && empty($_POST) + && ($_SERVER['CONTENT_LENGTH'] > 0) + ) { + $msg = _('The server was unable to handle that much POST ' . + 'data (%s bytes) due to its current configuration.'); + + $this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH'])); return; } - // Workaround for PHP returning empty $_FILES when POST length > PHP settings - - if (empty($_FILES) && ($_SERVER['CONTENT_LENGTH'] > 0)) { - common_debug('content-length = ' . $_SERVER['CONTENT_LENGTH']); - $this->clientError(_('Unable to handle that much POST data!')); + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); return; } @@ -129,7 +135,7 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction common_broadcast_profile($profile); - $twitter_user = $this->twitterUserArray($this->user->getProfile(), true); + $twitter_user = $this->twitterUserArray($profile, true); if ($this->format == 'xml') { $this->initDocument('xml');