From:             viaujoc at videotron dot ca
Operating system: Win2003
PHP version:      5.3.1
PHP Bug Type:     Filesystem function related
Bug description:  parse_ini_file() with INI_SCANNER_RAW cuts a value that 
includes a semi-colon

Description:
------------
When using parse_ini_file() function with $scanner_mode=INI_SCANNER_RAW,
any semi-colon (;) in the value is seen as the end of the value, even if it
is enclosed in quotes.

The behavior of parse_ini_file() in PHP 5.3 with either $scanner_mode at
RAW or NORMAL cannot reproduce the  behavior of PHP 5.2.

Reproduce code:
---------------
test.ini:
[TheSection]
MyKey="my;value\$"

example.php:
<?php
var_dump(parse_ini_file("test.ini",true,INI_SCANNER_RAW));
?>

Expected result:
----------------
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(10) "my;value\$"
  }
}

Actual result:
--------------
In PHP 5.2 (without the $scanner_mode parameter in parse_ini_file()):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(10) "my;value\$"
  }
}
(the value is returned exactly as it appears in test.ini)

In PHP 5.3 (with $scanner_mode=INI_SCANNER_RAW):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(3) ""my"
  }
}
(notice that everything after the semi-colon has been truncated and the
quote as the first character of the string)

In PHP 5.3 (with $scanner_mode=INI_SCANNER_NORMAL):
array(1) {
  ["TheSection"]=>
  array(1) {
    ["MyKey"]=>
    string(9) "my;value$"
  }
}
(notice the missing backslash (\) between the "e" and "$")

-- 
Edit bug report at http://bugs.php.net/?id=51094&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51094&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51094&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51094&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51094&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51094&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51094&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51094&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51094&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51094&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51094&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51094&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51094&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51094&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51094&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51094&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51094&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51094&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51094&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51094&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51094&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51094&r=mysqlcfg

Reply via email to