]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Thu, 5 Dec 2002 20:01:20 +0000 (20:01 +0000)
committerSVN Migration <svn@php.net>
Thu, 5 Dec 2002 20:01:20 +0000 (20:01 +0000)
ext/standard/tests/file/bug12556.phpt [new file with mode: 0644]
ext/standard/tests/file/test.csv [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug12556.phpt b/ext/standard/tests/file/bug12556.phpt
new file mode 100644 (file)
index 0000000..cac77e5
--- /dev/null
@@ -0,0 +1,49 @@
+--TEST--
+Bug #12556: fgetcvs ignores lengths when quotes not closed
+--POST--
+--GET--
+--FILE--
+<?php
+$fp = fopen(dirname(__FILE__)."/test.csv", "r");
+while($line = fgetcsv($fp, 24)) {
+       var_dump($line);
+}
+fclose($fp);
+?>
+--EXPECT--
+array(4) {
+  [0]=>
+  string(1) "6"
+  [1]=>
+  string(1) "7"
+  [2]=>
+  string(1) "8"
+  [3]=>
+  string(5) "line1"
+}
+array(4) {
+  [0]=>
+  string(1) "1"
+  [1]=>
+  string(1) "2"
+  [2]=>
+  string(1) "3"
+  [3]=>
+  string(186) "line2
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+"
+}
diff --git a/ext/standard/tests/file/test.csv b/ext/standard/tests/file/test.csv
new file mode 100644 (file)
index 0000000..d99984c
--- /dev/null
@@ -0,0 +1,17 @@
+6,7,8,line1
+1,2,3,"line2
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3
+2,4,5,line3