]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Settings/Display.php
Merge pull request #11150 from annando/user-banner
[friendica.git] / src / Module / Settings / Display.php
index cb7a520df6604590b0e22ec92ab08d83349cf042..cff75aac877212fdac8b2d23715c925da633fe17 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -30,14 +30,13 @@ use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Module\BaseSettings;
 use Friendica\Network\HTTPException;
-use Friendica\Util\Strings;
 
 /**
  * Module to update user settings
  */
 class Display extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       protected function post(array $request = [])
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -47,9 +46,9 @@ class Display extends BaseSettings
 
                $user = User::getById(local_user());
 
-               $theme                  = !empty($_POST['theme'])                  ? Strings::escapeTags(trim($_POST['theme'])) : $user['theme'];
-               $mobile_theme           = !empty($_POST['mobile_theme'])           ? Strings::escapeTags(trim($_POST['mobile_theme'])) : '';
-               $enable_smile           = !empty($_POST['enable_smile'])           ? intval($_POST['enable_smile'])            : 0;
+               $theme                  = !empty($_POST['theme'])                  ? trim($_POST['theme'])                : $user['theme'];
+               $mobile_theme           = !empty($_POST['mobile_theme'])           ? trim($_POST['mobile_theme'])         : '';
+               $enable_smile           = !empty($_POST['enable_smile'])           ? intval($_POST['enable_smile'])       : 0;
                $first_day_of_week      = !empty($_POST['first_day_of_week'])      ? intval($_POST['first_day_of_week'])  : 0;
                $infinite_scroll        = !empty($_POST['infinite_scroll'])        ? intval($_POST['infinite_scroll'])    : 0;
                $no_auto_update         = !empty($_POST['no_auto_update'])         ? intval($_POST['no_auto_update'])     : 0;
@@ -113,9 +112,9 @@ class Display extends BaseSettings
                DI::baseUrl()->redirect('settings/display');
        }
 
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
-               parent::content($parameters);
+               parent::content();
 
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));