cvs: php-src(PHP_5_2) /ext/standard file.c
| From: | Antony Dovgal | Date: | Fri, 18 Aug 2006 12:50:57 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-40032@lists.php.net to get a copy of this message | ||
tony2001 Fri Aug 18 12:50:57 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard file.c
Log:
MFH: add a notice to fgetcsv() when delimiter or enclosure is longer than 1 char
(feature request #38496)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.5&r2=1.409.2.6.2.6&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.5 php-src/ext/standard/file.c:1.409.2.6.2.6
--- php-src/ext/standard/file.c:1.409.2.6.2.5 Sat Jul 15 15:08:41 2006
+++ php-src/ext/standard/file.c Fri Aug 18 12:50:57 2006
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.409.2.6.2.5 2006/07/15 15:08:41 helly Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.6 2006/08/18 12:50:57 tony2001 Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -2003,6 +2003,8 @@
if (delimiter_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
+ } else if (delimiter_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -2013,7 +2015,10 @@
if (enclosure_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
+ } else if (enclosure_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
}
+
/* use first character from string */
enclosure = enclosure_str[0];
}