]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Mon, 24 Feb 2003 03:13:26 +0000 (03:13 +0000)
committerSVN Migration <svn@php.net>
Mon, 24 Feb 2003 03:13:26 +0000 (03:13 +0000)
ext/standard/tests/file/bug22382.phpt [new file with mode: 0644]
ext/standard/tests/file/test2.csv [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug22382.phpt b/ext/standard/tests/file/bug22382.phpt
new file mode 100644 (file)
index 0000000..5255eaf
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Bug #22382: fgetcvs does not handle escaped quotes correctly
+--POST--
+--GET--
+--FILE--
+<?php
+$fp = fopen(dirname(__FILE__)."/test2.csv", "r");
+while(($line = fgetcsv($fp, 1024))) {
+       var_dump($line);
+}
+fclose($fp);
+?>
+--EXPECT--
+array(6) {
+  [0]=>
+  string(3) "One"
+  [1]=>
+  string(7) "\"Two\""
+  [2]=>
+  string(7) "Three\""
+  [3]=>
+  string(4) "Four"
+  [4]=>
+  string(2) "\\"
+  [5]=>
+  string(28) "\\\\\\\\\\\\\\\\\\\\\\\"\\\\"
+}
\ No newline at end of file
diff --git a/ext/standard/tests/file/test2.csv b/ext/standard/tests/file/test2.csv
new file mode 100644 (file)
index 0000000..d816464
--- /dev/null
@@ -0,0 +1 @@
+"One","\"Two\"","Three\"","Four","\\","\\\\\\\\\\\\\\\\\\\\\\\"\\\\"