]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/designsettings.php
use caching in geonames plugin
[quix0rs-gnu-social.git] / lib / designsettings.php
index fdc05562e08fbfafd13ef12223ce626fba000288..5ce9ddedadf5529c516e94f372d06024f242b67c 100644 (file)
@@ -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;
             }
         }
 
@@ -325,7 +328,6 @@ class DesignSettingsAction extends AccountSettingsAction
         parent::showScripts();
 
         $this->script('js/farbtastic/farbtastic.js');
-        $this->script('js/farbtastic/farbtastic.go.js');
         $this->script('js/userdesign.go.js');
 
         $this->autofocus('design_background-image_file');