Fix deprecated eregi()

Replace eregi() with preg_replace()
This commit is contained in:
Eric Fawcett 2017-10-13 10:23:11 -04:00 committed by GitHub
parent f3520957a9
commit b73da4fd8a
1 changed files with 3 additions and 3 deletions

View File

@ -288,8 +288,8 @@
$normal = "^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$"; $normal = "^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$";
// define a regular expression for "strange looking" but syntactically valid addresses // define a regular expression for "strange looking" but syntactically valid addresses
$validButRare = "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})$"; $validButRare = "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})$";
if (eregi($normal, $email)) return true; if (preg_match($normal, $email)) return true;
else if (eregi($validButRare, $email)) return true; else if (preg_match($validButRare, $email)) return true;
else return false; else return false;
} }
function writeStyles() { function writeStyles() {
@ -304,4 +304,4 @@
echo "</style>"; echo "</style>";
} }
?> ?>