summaryrefslogtreecommitdiff
path: root/ext/filter/tests/bug50158.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/filter/tests/bug50158.phpt')
-rw-r--r--ext/filter/tests/bug50158.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/filter/tests/bug50158.phpt b/ext/filter/tests/bug50158.phpt
new file mode 100644
index 0000000..72c31a7
--- /dev/null
+++ b/ext/filter/tests/bug50158.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+
+$email_address = "test=mail@example.com";
+var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
+
+$email_address = "test-mail@example.com";
+var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
+
+$email_address = "test+mail@example.com";
+var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
+
+$email_address = "test?mail@example.com";
+var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
+
+?>
+--EXPECTF--
+%unicode|string%(21) "test=mail@example.com"
+%unicode|string%(21) "test-mail@example.com"
+%unicode|string%(21) "test+mail@example.com"
+%unicode|string%(21) "test?mail@example.com"