X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=080bcdeb93848a7cc086c60798583752a3b17be3;hb=0c26ae31f6ca925cd88a53a47c2484c7078950e8;hp=e84917c35c67c9d9361e72ac214b4676fc563812;hpb=1d86d79778bb7e2d00bd9031877e566a6037144e;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index e84917c35c..080bcdeb93 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -37,7 +37,6 @@ use Friendica\Model\User; use Friendica\Module\BaseSettings; use Friendica\Module\Security\Login; use Friendica\Protocol\Email; -use Friendica\Util\Strings; use Friendica\Util\Temporal; use Friendica\Worker\Delivery; @@ -216,14 +215,14 @@ function settings_post(App $a) } } - $username = (!empty($_POST['username']) ? Strings::escapeTags(trim($_POST['username'])) : ''); - $email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : ''); - $timezone = (!empty($_POST['timezone']) ? Strings::escapeTags(trim($_POST['timezone'])) : ''); - $language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : ''); + $username = (!empty($_POST['username']) ? trim($_POST['username']) : ''); + $email = (!empty($_POST['email']) ? trim($_POST['email']) : ''); + $timezone = (!empty($_POST['timezone']) ? trim($_POST['timezone']) : ''); + $language = (!empty($_POST['language']) ? trim($_POST['language']) : ''); - $defloc = (!empty($_POST['defloc']) ? Strings::escapeTags(trim($_POST['defloc'])) : ''); - $maxreq = (!empty($_POST['maxreq']) ? intval($_POST['maxreq']) : 0); - $expire = (!empty($_POST['expire']) ? intval($_POST['expire']) : 0); + $defloc = (!empty($_POST['defloc']) ? trim($_POST['defloc']) : ''); + $maxreq = (!empty($_POST['maxreq']) ? intval($_POST['maxreq']) : 0); + $expire = (!empty($_POST['expire']) ? intval($_POST['expire']) : 0); $def_gid = (!empty($_POST['group-selection']) ? intval($_POST['group-selection']) : 0); @@ -309,7 +308,9 @@ function settings_post(App $a) if ($email != $user['email']) { // check for the correct password - if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) { + try { + User::getIdFromPasswordAuthentication(local_user(), $_POST['mpassword']); + } catch (Exception $ex) { $err .= DI::l10n()->t('Wrong Password.'); $email = $user['email']; } @@ -492,7 +493,7 @@ function settings_content(App $a) $settings_connectors = ''; Hook::callAll('connector_settings', $settings_connectors); - if (is_site_admin()) { + if ($a->isSiteAdmin()) { $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled'))); $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled'))); } else {