mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
commit
415e7b5f8b
3 changed files with 20 additions and 15 deletions
|
@ -41,13 +41,13 @@ class Site extends BaseAdmin
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sitename = (!empty($_POST['sitename']) ? trim($_POST['sitename']) : '');
|
$sitename = (!empty($_POST['sitename']) ? strip_tags(trim($_POST['sitename'])) : '');
|
||||||
$sender_email = (!empty($_POST['sender_email']) ? trim($_POST['sender_email']) : '');
|
$sender_email = (!empty($_POST['sender_email']) ? trim($_POST['sender_email']) : '');
|
||||||
$banner = (!empty($_POST['banner']) ? trim($_POST['banner']) : false);
|
$banner = (!empty($_POST['banner']) ? trim($_POST['banner']) : false);
|
||||||
$email_banner = (!empty($_POST['email_banner']) ? trim($_POST['email_banner']) : false);
|
$email_banner = (!empty($_POST['email_banner']) ? trim($_POST['email_banner']) : false);
|
||||||
$shortcut_icon = (!empty($_POST['shortcut_icon']) ? trim($_POST['shortcut_icon']) : '');
|
$shortcut_icon = (!empty($_POST['shortcut_icon']) ? trim($_POST['shortcut_icon']) : '');
|
||||||
$touch_icon = (!empty($_POST['touch_icon']) ? trim($_POST['touch_icon']) : '');
|
$touch_icon = (!empty($_POST['touch_icon']) ? trim($_POST['touch_icon']) : '');
|
||||||
$additional_info = (!empty($_POST['additional_info']) ? trim($_POST['additional_info']) : '');
|
$additional_info = (!empty($_POST['additional_info']) ? strip_tags(trim($_POST['additional_info'])) : '');
|
||||||
$language = (!empty($_POST['language']) ? trim($_POST['language']) : '');
|
$language = (!empty($_POST['language']) ? trim($_POST['language']) : '');
|
||||||
$theme = (!empty($_POST['theme']) ? trim($_POST['theme']) : '');
|
$theme = (!empty($_POST['theme']) ? trim($_POST['theme']) : '');
|
||||||
$theme_mobile = (!empty($_POST['theme_mobile']) ? trim($_POST['theme_mobile']) : '');
|
$theme_mobile = (!empty($_POST['theme_mobile']) ? trim($_POST['theme_mobile']) : '');
|
||||||
|
@ -57,7 +57,7 @@ class Site extends BaseAdmin
|
||||||
$jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality'])) : 100);
|
$jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality'])) : 100);
|
||||||
|
|
||||||
$register_policy = (!empty($_POST['register_policy']) ? intval(trim($_POST['register_policy'])) : 0);
|
$register_policy = (!empty($_POST['register_policy']) ? intval(trim($_POST['register_policy'])) : 0);
|
||||||
$max_registered_users = (!empty($_POST['max_registered_users']) ? intval(trim($_POST['max_registered_users'])) : 0);
|
$max_registered_users = (!empty($_POST['max_registered_users']) ? intval(trim($_POST['max_registered_users'])) : 0);
|
||||||
$daily_registrations = (!empty($_POST['max_daily_registrations']) ? intval(trim($_POST['max_daily_registrations'])) : 0);
|
$daily_registrations = (!empty($_POST['max_daily_registrations']) ? intval(trim($_POST['max_daily_registrations'])) : 0);
|
||||||
$abandon_days = (!empty($_POST['abandon_days']) ? intval(trim($_POST['abandon_days'])) : 0);
|
$abandon_days = (!empty($_POST['abandon_days']) ? intval(trim($_POST['abandon_days'])) : 0);
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,8 @@ class Photos extends \Friendica\Module\BaseProfile
|
||||||
$request = $hook_data['request'] ?? $request;
|
$request = $hook_data['request'] ?? $request;
|
||||||
|
|
||||||
// Determine the album to use
|
// Determine the album to use
|
||||||
$album = trim($request['album'] ?? '');
|
$album = strip_tags(trim($request['album'] ?? ''));
|
||||||
$newalbum = trim($request['newalbum'] ?? '');
|
$newalbum = strip_tags(trim($request['newalbum'] ?? ''));
|
||||||
|
|
||||||
$this->logger->debug('album= ' . $album . ' newalbum= ' . $newalbum);
|
$this->logger->debug('album= ' . $album . ' newalbum= ' . $newalbum);
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ class Index extends BaseSettings
|
||||||
new ArrayFilterEvent(ArrayFilterEvent::PROFILE_SETTINGS_POST, $request),
|
new ArrayFilterEvent(ArrayFilterEvent::PROFILE_SETTINGS_POST, $request),
|
||||||
)->getArray();
|
)->getArray();
|
||||||
|
|
||||||
$dob = trim($request['dob'] ?? '');
|
$dob = $this->cleanInput($request['dob'] ?? '');
|
||||||
|
|
||||||
if ($dob && !in_array($dob, ['0000-00-00', DBA::NULL_DATE])) {
|
if ($dob && !in_array($dob, ['0000-00-00', DBA::NULL_DATE])) {
|
||||||
$y = substr($dob, 0, 4);
|
$y = substr($dob, 0, 4);
|
||||||
|
@ -121,18 +121,18 @@ class Index extends BaseSettings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$username = trim($request['username'] ?? '');
|
$username = $this->cleanInputText($request['username'] ?? '');
|
||||||
if (!$username) {
|
if (!$username) {
|
||||||
$this->systemMessages->addNotice($this->t('Display Name is required.'));
|
$this->systemMessages->addNotice($this->t('Display Name is required.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$about = trim($request['about']);
|
$about = $this->cleanInputText($request['about']);
|
||||||
$address = trim($request['address']);
|
$address = $this->cleanInputText($request['address']);
|
||||||
$locality = trim($request['locality']);
|
$locality = $this->cleanInputText($request['locality']);
|
||||||
$region = trim($request['region']);
|
$region = $this->cleanInputText($request['region']);
|
||||||
$postal_code = trim($request['postal_code']);
|
$postal_code = $this->cleanInputText($request['postal_code']);
|
||||||
$country_name = trim($request['country_name']);
|
$country_name = $this->cleanInputText($request['country_name']);
|
||||||
$pub_keywords = self::cleanKeywords(trim($request['pub_keywords']));
|
$pub_keywords = self::cleanKeywords(trim($request['pub_keywords']));
|
||||||
$prv_keywords = self::cleanKeywords(trim($request['prv_keywords']));
|
$prv_keywords = self::cleanKeywords(trim($request['prv_keywords']));
|
||||||
$xmpp = $this->cleanInput(trim($request['xmpp']));
|
$xmpp = $this->cleanInput(trim($request['xmpp']));
|
||||||
|
@ -377,9 +377,14 @@ class Index extends BaseSettings
|
||||||
return $profileFields;
|
return $profileFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function cleanInputText(string $input): string
|
||||||
|
{
|
||||||
|
return trim(strip_tags($input));
|
||||||
|
}
|
||||||
|
|
||||||
private function cleanInput(string $input): string
|
private function cleanInput(string $input): string
|
||||||
{
|
{
|
||||||
return str_replace(['<', '>', '"', ' '], '', $input);
|
return str_replace(['<', '>', '"', "'", ' '], '', $input);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function cleanKeywords($keywords): string
|
private static function cleanKeywords($keywords): string
|
||||||
|
@ -389,7 +394,7 @@ class Index extends BaseSettings
|
||||||
|
|
||||||
$cleaned = [];
|
$cleaned = [];
|
||||||
foreach ($keywords as $keyword) {
|
foreach ($keywords as $keyword) {
|
||||||
$keyword = trim($keyword);
|
$keyword = trim(str_replace(['<', '>', '"', "'"], '', $keyword));
|
||||||
$keyword = trim($keyword, '#');
|
$keyword = trim($keyword, '#');
|
||||||
if ($keyword != '') {
|
if ($keyword != '') {
|
||||||
$cleaned[] = $keyword;
|
$cleaned[] = $keyword;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue