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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
--TEST--
url parser multibyte/utf-8/idna
--SKIPIF--
<?php
include "skipif.inc";
if (!defined("http\\Url::PARSE_TOIDN")) {
die("skip need http\\Url::PARSE_TOIDN support");
}
?>
--FILE--
<?php
echo "Test\n";
$urls = array(
"s\xc3\xa7heme:",
"s\xc3\xa7heme://h\xc6\x9fst",
"s\xc3\xa7heme://h\xc6\x9fst:23/päth/öf/fıle"
);
foreach ($urls as $url) {
printf("\n%s\n", $url);
var_dump(new http\Url($url, null, http\Url::PARSE_MBUTF8|http\Url::PARSE_TOIDN));
}
?>
DONE
--EXPECTF--
Test
sçheme:
object(http\Url)#%d (8) {
["scheme"]=>
string(7) "sçheme"
["user"]=>
NULL
["pass"]=>
NULL
["host"]=>
NULL
["port"]=>
NULL
["path"]=>
NULL
["query"]=>
NULL
["fragment"]=>
NULL
}
sçheme://hƟst
object(http\Url)#%d (8) {
["scheme"]=>
string(7) "sçheme"
["user"]=>
NULL
["pass"]=>
NULL
["host"]=>
string(11) "xn--hst-kwb"
["port"]=>
NULL
["path"]=>
NULL
["query"]=>
NULL
["fragment"]=>
NULL
}
sçheme://hƟst:23/päth/öf/fıle
object(http\Url)#%d (8) {
["scheme"]=>
string(7) "sçheme"
["user"]=>
NULL
["pass"]=>
NULL
["host"]=>
string(11) "xn--hst-kwb"
["port"]=>
int(23)
["path"]=>
string(16) "/päth/öf/fıle"
["query"]=>
NULL
["fragment"]=>
NULL
}
DONE
|