summaryrefslogtreecommitdiff
path: root/ext/filter/tests/bug50158.phpt
blob: cfa856d97cfbcbf30e0e617a6d5d2edf16e7c6ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"