mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
PHRAS-4073: Register form - improvement (#4520)
* sanitize register form * fix
This commit is contained in:
@@ -204,7 +204,7 @@ class RegistrationService
|
||||
|
||||
foreach (self::$userPropertySetterMap as $property => $method) {
|
||||
if (isset($data[$property])) {
|
||||
$user->$method($data[$property]);
|
||||
$user->$method($this->app['unicode']->remove_nonazAZ09($data[$property], true, true, true, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1643,7 +1643,7 @@ class unicode
|
||||
return $this->convert($string, static::CONVERT_TO_ND);
|
||||
}
|
||||
|
||||
public function remove_nonazAZ09($string, $keep_underscores = true, $keep_minus = true, $keep_dot = false)
|
||||
public function remove_nonazAZ09($string, $keep_underscores = true, $keep_minus = true, $keep_dot = false, $keep_space = false)
|
||||
{
|
||||
$string = $this->remove_diacritics($string);
|
||||
|
||||
@@ -1652,7 +1652,7 @@ class unicode
|
||||
for ($i = 0; $i < $l; $i ++) {
|
||||
$c = mb_substr($string, $i, 1);
|
||||
if(($c>='a'&&$c<='z')||($c>='A'&&$c<='Z')||($c>='0'&&$c<='9')
|
||||
||($keep_underscores&&$c=='_')||($keep_dot&&$c=='.')||($keep_minus&&$c=='-')) {
|
||||
||($keep_underscores&&$c=='_')||($keep_dot&&$c=='.')||($keep_minus&&$c=='-')||($keep_space&&$c==' ')) {
|
||||
$out .= $c;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user