1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Files
archived-php-src/ext/standard/tests/network/bug69948.phpt
George Peter Banyard 72223159e4 Promote warnings to errors for set(raw)cookie()
Closes GH-5819
2020-09-08 14:28:49 +02:00

23 lines
612 B
PHP

--TEST--
Bug #69948 (path/domain are not sanitized for special characters in setcookie)
--FILE--
<?php
try {
var_dump(setcookie('foo', 'bar', 0, 'asdf;asdf'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(setcookie('foo', 'bar', 0, '/', 'foobar; secure'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
===DONE===
--EXPECTHEADERS--
--EXPECT--
setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
===DONE===