mirror of
https://github.com/php/php-src.git
synced 2026-04-18 05:21:02 +02:00
This format matches against null bytes, and prevents the test expectation from being interpreted as binary data. bless_tests.php will automatically replace \0 with %0 as well.
21 lines
347 B
PHP
21 lines
347 B
PHP
--TEST--
|
|
Bug #40915 (addcslashes unexpected behavior with binary input)
|
|
--FILE--
|
|
<?php
|
|
|
|
$str = "a\000z";
|
|
|
|
var_dump(addslashes($str));
|
|
var_dump(addcslashes($str, ""));
|
|
var_dump(addcslashes($str, "\000z"));
|
|
var_dump(addcslashes($str, "z"));
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
string(4) "a\0z"
|
|
string(3) "a%0z"
|
|
string(7) "a\000\z"
|
|
string(4) "a%0\z"
|
|
Done
|