X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdesignsettings.php;h=5ce9ddedadf5529c516e94f372d06024f242b67c;hb=69ac99ff949ab0118ff25a62471980ad0ec7a52b;hp=820d534f23eadc4d9ecb60d8a3d54e7067c6611e;hpb=44820d296dd0c00cef9b48af3a3574f765042715;p=quix0rs-gnu-social.git diff --git a/lib/designsettings.php b/lib/designsettings.php index 820d534f23..5ce9ddedad 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -271,17 +271,20 @@ class DesignSettingsAction extends AccountSettingsAction function handlePost() { - // XXX: Robin's workaround for a bug in PHP where $_POST - // and $_FILE are empty in the case that the uploaded - // file is bigger than PHP is configured to handle. - if ($_SERVER['REQUEST_METHOD'] == 'POST') { - if (empty($_POST) && $_SERVER['CONTENT_LENGTH']) { + // 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->showForm(sprintf($msg, $_SERVER['CONTENT_LENGTH'])); + return; } }