1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

Minor adjustments

This commit is contained in:
Ryan Cramer
2019-04-19 09:19:03 -04:00
parent 761c7640c7
commit 2a63a44485
3 changed files with 6 additions and 0 deletions

View File

@@ -145,6 +145,7 @@ class WireMail extends WireData implements WireMailInterface {
*
*/
protected function sanitizeEmail($email) {
if(!strlen($email)) return '';
$email = strtolower(trim($email));
$clean = $this->wire('sanitizer')->email($email);
if($email !== $clean) {

View File

@@ -446,6 +446,10 @@ class WireMailTools extends Wire {
$inBlacklist = false;
$tt = $this->wire('sanitizer')->getTextTools();
$email = trim($tt->strtolower($email));
if(strpos($email, '@') === false) {
return $options['why'] ? "Invalid email address" : true;
}
foreach($blacklist as $line) {
$line = $tt->strtolower(trim($line));