jani            Sun Aug 31 00:19:21 2008 UTC

  Modified files:              
    /php-src/ext/standard       basic_functions.c 
    /php-src/ext/standard/tests/file    parse_ini_file.phpt 
                                        parse_ini_file_error.phpt 
    /php-src/ext/standard/tests/general_functions       parse_ini_basic.phpt 
                                                        
parse_ini_file-win32.phpt 
                                                        parse_ini_file.phpt 
  Log:
  [DOC]- Fixed bug #45956 (parse_ini_file() does not return false with syntax 
errors in parsed file)
  [DOC] note: change will be in since 5.2.7
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.928&r2=1.929&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.928 
php-src/ext/standard/basic_functions.c:1.929
--- php-src/ext/standard/basic_functions.c:1.928        Fri Aug 22 15:51:50 2008
+++ php-src/ext/standard/basic_functions.c      Sun Aug 31 00:19:20 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.928 2008/08/22 15:51:50 felipe Exp $ */
+/* $Id: basic_functions.c,v 1.929 2008/08/31 00:19:20 jani Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -6491,7 +6491,11 @@
        fh.type = ZEND_HANDLE_FILENAME;
 
        array_init(return_value);
-       zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value 
TSRMLS_CC);
+       if (zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, 
return_value TSRMLS_CC) == FAILURE) {
+               zend_hash_destroy(Z_ARRVAL_P(return_value));
+               efree(Z_ARRVAL_P(return_value));
+               RETURN_FALSE;
+       }
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/parse_ini_file.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/standard/tests/file/parse_ini_file.phpt
diff -u php-src/ext/standard/tests/file/parse_ini_file.phpt:1.4 
php-src/ext/standard/tests/file/parse_ini_file.phpt:1.5
--- php-src/ext/standard/tests/file/parse_ini_file.phpt:1.4     Tue May 27 
09:34:54 2008
+++ php-src/ext/standard/tests/file/parse_ini_file.phpt Sun Aug 31 00:19:21 2008
@@ -9,7 +9,7 @@
 
 $file_path = dirname(__FILE__);
 
-$parse_string = <<<EOD
+$parse_string = (binary) <<<EOD
 ; Comment starts with semi-colon(;)
 ; Section starts with [<section name>]
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/parse_ini_file_error.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/file/parse_ini_file_error.phpt
diff -u php-src/ext/standard/tests/file/parse_ini_file_error.phpt:1.2 
php-src/ext/standard/tests/file/parse_ini_file_error.phpt:1.3
--- php-src/ext/standard/tests/file/parse_ini_file_error.phpt:1.2       Wed Mar 
19 17:26:36 2008
+++ php-src/ext/standard/tests/file/parse_ini_file_error.phpt   Sun Aug 31 
00:19:21 2008
@@ -42,12 +42,10 @@
 -- Testing parse_ini_file() function with more than expected no. of arguments 
--
 
 Warning: parse_ini_file(%s): failed to open stream: No such file or directory 
in %s on line %d
-array(0) {
-}
+bool(false)
 
 -- Testing parse_ini_file() function with a non-existent file --
 
 Warning: parse_ini_file(%s): failed to open stream: No such file or directory 
in %s on line %d
-array(0) {
-}
+bool(false)
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt
diff -u php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt:1.5 
php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt:1.6
--- php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt:1.5       
Tue May 27 00:04:31 2008
+++ php-src/ext/standard/tests/general_functions/parse_ini_basic.phpt   Sun Aug 
31 00:19:21 2008
@@ -45,7 +45,7 @@
     [u"dqstring"]=>
     unicode(46) "asdadfsdjkslkj [EMAIL PROTECTED] { } !^~|¥¥{[()/)&/% ¤ # #"
     [u"php_constant"]=>
-    unicode(5) "16383"
+    unicode(5) "32767"
     [u"user_constant"]=>
     unicode(21) "this_is_test_constant"
   }
@@ -76,7 +76,7 @@
     [u"dqstring"]=>
     unicode(34) "asdadfsdjkslkj [EMAIL PROTECTED]()/)&/%#¤"
     [u"php_constant"]=>
-    unicode(5) "16383"
+    unicode(5) "32767"
   }
   [u"comments"]=>
   array(1) {
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt
diff -u 
php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt:1.1 
php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt:1.2
--- php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt:1.1  
Thu Aug 21 13:04:43 2008
+++ php-src/ext/standard/tests/general_functions/parse_ini_file-win32.phpt      
Sun Aug 31 00:19:21 2008
@@ -116,12 +116,10 @@
 bool(false)
 
 Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s.php on line 8
-array(0) {
-}
+bool(false)
 
 Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s.php on line 9
-array(0) {
-}
+bool(false)
 array(1) {
   ["test"]=>
   string(0) ""
@@ -129,17 +127,11 @@
 
 Warning: parse error in %s on line %d
  in %s on line 20
-array(1) {
-  ["test"]=>
-  string(0) ""
-}
+bool(false)
 
 Warning: parse error in %s on line %d
  in %s on line 26
-array(1) {
-  ["test"]=>
-  string(4) "test"
-}
+bool(false)
 array(1) {
   ["test"]=>
   string(8) "new
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file.phpt?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/standard/tests/general_functions/parse_ini_file.phpt
diff -u php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.8 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.9
--- php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.8        
Thu Aug 21 13:04:43 2008
+++ php-src/ext/standard/tests/general_functions/parse_ini_file.phpt    Sun Aug 
31 00:19:21 2008
@@ -116,12 +116,10 @@
 bool(false)
 
 Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %sparse_ini_file.php on line 8
-array(0) {
-}
+bool(false)
 
 Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %sparse_ini_file.php on line 9
-array(0) {
-}
+bool(false)
 array(1) {
   [u"test"]=>
   unicode(0) ""
@@ -129,17 +127,11 @@
 
 Warning: %s error%sin %sparse_ini_file.dat on line 2
  in %sparse_ini_file.php on line 20
-array(1) {
-  [u"test"]=>
-  unicode(0) ""
-}
+bool(false)
 
 Warning: %serror%sin %sparse_ini_file.dat on line 2
  in %sparse_ini_file.php on line 26
-array(1) {
-  [u"test"]=>
-  unicode(4) "test"
-}
+bool(false)
 array(1) {
   [u"test"]=>
   unicode(8) "new



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to