X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdesignsettings.php;h=5ce9ddedadf5529c516e94f372d06024f242b67c;hb=85ec057422439e5555883bd77f211529a02bf5db;hp=b86265971c6645012dc030fcdc947f64e2ffc737;hpb=d0baab6978f1959382d568d26cc9f8f552a7b764;p=quix0rs-gnu-social.git diff --git a/lib/designsettings.php b/lib/designsettings.php index b86265971c..5ce9ddedad 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -1,6 +1,6 @@ . * * @category Settings - * @package Laconica - * @author Sarven Capadisli - * @author Zach Copley - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Sarven Capadisli + * @author Zach Copley + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,11 +42,11 @@ require_once INSTALLDIR . '/lib/webcolor.php'; * background images, and fetching a default design * * @category Settings - * @package Laconica - * @author Zach Copley - * @author Sarven Capadisli + * @package StatusNet + * @author Zach Copley + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class DesignSettingsAction extends AccountSettingsAction @@ -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,8 +328,9 @@ 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'); } /**