tony2001 Fri Aug 18 12:50:36 2006 UTC
Modified files:
/php-src/ext/standard file.c
Log:
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.449&r2=1.450&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.449 php-src/ext/standard/file.c:1.450
--- php-src/ext/standard/file.c:1.449 Sun Jul 16 15:54:25 2006
+++ php-src/ext/standard/file.c Fri Aug 18 12:50:36 2006
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.449 2006/07/16 15:54:25 tony2001 Exp $ */
+/* $Id: file.c,v 1.450 2006/08/18 12:50:36 tony2001 Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -2081,6 +2081,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 */
@@ -2091,7 +2093,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];
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php