Edit report at https://bugs.php.net/bug.php?id=63512&edit=1

 ID:                 63512
 Updated by:         pierr...@php.net
 Reported by:        arjen at react dot com
 Summary:            parse_ini_file() with INI_SCANNER_RAW removes quotes
                     from value.
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   All
 PHP Version:        5.3.18
 Assigned To:        pierrick
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of pierrick
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=6dff07aa8c6fcf6cd84a2d1726ffcaeef74b9969
Log: Fixed bug #63512 parse_ini_file() with INI_SCANNER_RAW removes quotes from 
value


Previous Comments:
------------------------------------------------------------------------
[2012-11-16 01:23:41] pierr...@php.net

Current status is : 
- we can't as suggested keep all " to make a "real" raw, because of BC
- we can't remove all the quotes would not make sense for some cases like
  c = "waa" INSTALL_ROOT
- we need to fix the bug where c="foo;bar" will result in c="foo (This is why 
the 
commit causing the current bug was first made)

So I think this patch is the best one for the moment since it fix the original 
bug, and keep the old behaviour to keep BC.

------------------------------------------------------------------------
[2012-11-15 13:39:18] larue...@php.net

codes looks fine, and new comment coming :)
thanks

------------------------------------------------------------------------
[2012-11-15 13:32:23] arjen at react dot com

With this patch, the old behaviour is restored. But the "eat leading and 
trailing quotes" does 
not make sense..

var_dump(parse_ini_string('waa = "string" CONSTANT "anotherString"', false, 
INI_SCANNER_RAW));

5.3.18 (wrong):
array(1) {
  ["waa"]=>
  string(29) "string CONSTANT anotherString"
}

with patch (behaviour like in versions < 5.3.15)

array(1) {
  ["waa"]=>
  string(29) "string" CONSTANT "anotherString"
}


Now string appears to be the constant, and CONSTANT a quoted string..

expected/better:
array(1) {
  ["waa"]=>
  string(29) ""string" CONSTANT "anotherString""
}

So IHMO remove this whole trim quotes thingy.

------------------------------------------------------------------------
[2012-11-15 04:46:29] pierr...@php.net

The following patch has been added/updated:

Patch Name: 63512-v3.diff
Revision:   1352954789
URL:        
https://bugs.php.net/patch-display.php?bug=63512&patch=63512-v3.diff&revision=1352954789

------------------------------------------------------------------------
[2012-11-15 04:45:54] pierr...@php.net

I created a patch for this bug (which also fix #62884).

Could you make a quick code review before I commit it ? 

Thanks

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63512


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63512&edit=1

Reply via email to