xref: /PHP-5.6/ext/filter/tests/bug50158.phpt (revision d7be9cf6)
1--TEST--
2Bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?)
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7
8$email_address = "test=mail@example.com";
9var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
10
11$email_address = "test-mail@example.com";
12var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
13
14$email_address = "test+mail@example.com";
15var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
16
17$email_address = "test?mail@example.com";
18var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
19
20?>
21--EXPECTF--
22%unicode|string%(21) "test=mail@example.com"
23%unicode|string%(21) "test-mail@example.com"
24%unicode|string%(21) "test+mail@example.com"
25%unicode|string%(21) "test?mail@example.com"
26