]> granicus.if.org Git - php/commitdiff
Fix stripslashes when magic_quotes_sybase is enabled, and add a test for
authorSander Roobol <sander@php.net>
Tue, 18 Jun 2002 11:42:21 +0000 (11:42 +0000)
committerSander Roobol <sander@php.net>
Tue, 18 Jun 2002 11:42:21 +0000 (11:42 +0000)
add- and stripslashes().

ext/standard/tests/strings/add-and-stripslashes.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/strings/add-and-stripslashes.phpt b/ext/standard/tests/strings/add-and-stripslashes.phpt
new file mode 100644 (file)
index 0000000..bc0a96b
--- /dev/null
@@ -0,0 +1,21 @@
+--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 "FAILE                     right_nimized case to avoid callOK\n";
+} else {
+       echo "FAILE                     right_nimizeding ni-hr= php_name(TSRMLS_C).= Pymbol",  ;i<lenusing 'nacalgorithm */
+PHP_FUNCTION(strnatcesult) {RONG} eTRLEN_
\ No newline at end of file