From:  pear-qa@lists.php.net ("amcconaughey@gmail.com")
Date:  04 Feb 2015 07:12:40 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20498 [Com]: If the config contains 2 backslashes it is handled as an escape removing 1

NNTP-Posting-Host:  null

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

 ID:               20498
 Comment by:       amcconaughey@gmail.com
 Reported By:      amcconaughey at gmail dot com
 Summary:          If the config contains 2 backslashes it is handled as
                    an escape removing 1
 Status:           Open
 Type:             Bug
 Package:          Config_Lite
 Operating System: Mac and Windows
 Package Version:  0.2.1
 PHP Version:      5.5.21
 Roadmap Versions: 
 New Comment:

I did find a solution, in parse_ini_file adding the flag INI_SCANNER_RAW
fixes it, and for us we can just outright add it, but I am not sure how
you would want to make it optional in the long run. I suggest optional
because that is how parse_ini_file handles it.


Previous Comments:
------------------------------------------------------------------------

[2015-02-03 22:59:47] alesandreo

Description:
------------
If there is a set of backslashes \\ say when working with a 
windows network share in the config, they are combined into a 
single \.

eg. \\test.corp.com\ becomes \test.corp.com\

Test script:
---------------
// test_config.ini
//[Repository]
//BuildLocation = "\\\test.corp.com\"
//RepoUser = "qa@corp.com"
//RepoPass = "Password01"

$test_config = new Config_Lite("test_config.ini");
$test_config->save();

// test_config.ini
//[Repository]
//BuildLocation = "\\test.corp.com\"
//RepoUser = "qa@corp.com"
//RepoPass = "Password01"

Expected result:
----------------
If I read in the config and write it back out, the values should not 
be changed. Quotes can be added etc, but the value should be 
consistent.

Actual result:
--------------
// test_config.ini
//[Repository]
//BuildLocation = "\\\test.corp.com\"
//RepoUser = "qa@corp.com"
//RepoPass = "Password01"

/** becomes **/

// test_config.ini
//[Repository]
//BuildLocation = "\\test.corp.com\"
//RepoUser = "qa@corp.com"
//RepoPass = "Password01"

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


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