summaryrefslogtreecommitdiff
path: root/actions/avatarsettings.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-07 13:03:52 -0500
committerEvan Prodromou <evan@status.net>2009-11-07 13:03:52 -0500
commitd9cde0ef80ee838a99035d44f0286b3cc902e332 (patch)
treeac9d74d52a06890db71f61ac934e75b937c19753 /actions/avatarsettings.php
parentf2b642ce822c480cfc418c38106cc18c3a428cf4 (diff)
parent2d8ad0409d8e78ec35a65156bc375eacbe561963 (diff)
Merge branch '0.9.x' into userflag
Diffstat (limited to 'actions/avatarsettings.php')
-rw-r--r--actions/avatarsettings.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php
index ded419dd7..879e44842 100644
--- a/actions/avatarsettings.php
+++ b/actions/avatarsettings.php
@@ -244,11 +244,25 @@ class AvatarsettingsAction extends AccountSettingsAction
function handlePost()
{
+ // 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;
+ }
+
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
- $this->show_form(_('There was a problem with your session token. '.
+ $this->showForm(_('There was a problem with your session token. '.
'Try again, please.'));
return;
}