![](http://board.herc.ws/uploads/set_resources_4/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Takuya
-
Content Count
1 -
Joined
-
Last visited
Reputation Activity
-
Takuya got a reaction from Sidra Harris in Flux CP > block [email protected] From the register on the site
You really shouldn't use eregi, the ereg-extension has already been thrown out of PHP by default and it contains many problems, including security-related ones.
Stick to preg and use proper PHP validation, go for something like
if (!filter_var($email, FILTER_VALIDATE_EMAIL) || preg_match('/@(mailinator|hotmail|trashmail)\..+$/i', $email)) throw new Flux_RegisterError('Invalid e-mail address', Flux_RegisterError::INVALID_EMAIL_ADDRESS);
For more information visit the PHP documentation on ereg and on filter_var. Keep your servers safe, folks.
-
Takuya got a reaction from Monsieur Panda in Flux CP > block [email protected] From the register on the site
You really shouldn't use eregi, the ereg-extension has already been thrown out of PHP by default and it contains many problems, including security-related ones.
Stick to preg and use proper PHP validation, go for something like
if (!filter_var($email, FILTER_VALIDATE_EMAIL) || preg_match('/@(mailinator|hotmail|trashmail)\..+$/i', $email)) throw new Flux_RegisterError('Invalid e-mail address', Flux_RegisterError::INVALID_EMAIL_ADDRESS);
For more information visit the PHP documentation on ereg and on filter_var. Keep your servers safe, folks.