Fixed handling long emails

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2022-03-14 20:30:06 +01:00
parent 7d655b569d
commit d38e5e281f
2 changed files with 4 additions and 10 deletions

View File

@ -843,6 +843,10 @@ class ModelSearchSearch extends Model {
public function fix_email_address_for_sphinx($email = '') {
if(strlen($email) > MAX_EMAIL_LEN) {
return md5($email . ' ');
}
$email = preg_replace("/\|@/", "|", $email);
return preg_replace("/[\@\.\+\-\_]/", "X", $email);
}