php-src/ext/standard/tests/strings/add-and-stripslashes.phpt
Sander Roobol ace4a23dfc Fixed stripslashes when magic_quotes_sybase is enabled, and add a test for
add- and stripslashes().
# this time without cvs messing up and aborting, hopefully :)
2002-06-18 11:51:06 +00:00

33 lines
503 B
PHP

--TEST--
addslashes() and stripslashes() functions, normal and sybase-style
--POST--
--GET--
--FILE--
<?php
$input = '';
for($i=0; $i<512; $i++) {
$input .= chr($i%256);
}
echo "Normal: ";
ini_set('magic_quotes_sybase', 0);
if($input === stripslashes(addslashes($input))) {
echo "OK\n";
} else {
echo "FAILED\n";
}
echo "Sybase: ";
ini_set('magic_quotes_sybase', 1);
if($input === stripslashes(addslashes($input))) {
echo "OK\n";
} else {
echo "FAILED\n";
}
?>
--EXPECT--
Normal: OK
Sybase: OK