diff options
-rw-r--r-- | include/network.php | 2 | ||||
-rw-r--r-- | tests/unit/includes/NetworkTest.php | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/network.php b/include/network.php index 0a78c144b..50e8b1c89 100644 --- a/include/network.php +++ b/include/network.php @@ -612,7 +612,7 @@ function validate_email(string $addr): bool { $matches = array(); $result = preg_match( - '/^[A-Z0-9._%-]+@([A-Z0-9.-]+\.[A-Z0-9-]{2,})$/i', + '/^[A-Z0-9._%+-]+@([A-Z0-9.-]+\.[A-Z0-9-]{2,})$/i', punify($addr), $matches); diff --git a/tests/unit/includes/NetworkTest.php b/tests/unit/includes/NetworkTest.php index a41075f25..ea1fd6fa0 100644 --- a/tests/unit/includes/NetworkTest.php +++ b/tests/unit/includes/NetworkTest.php @@ -60,7 +60,11 @@ class NetworkTest extends Zotlabs\Tests\Unit\UnitTestCase { ['some.email@example.cancerresearch', true], // And internationalized TLD's - ['some.email@example.شبكة', true] + ['some.email@example.شبكة', true], + + // Allow plus/minus addressing + ['address+tag@example.com', true], + ['address-tag@example.com', true], ]; } } |