<?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
*
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.'));
$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;
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.'));