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

From: Date: Tue, 03 Feb 2015 23:12:40 +0000
Subject: Bug #20498 [Com]: If the config contains 2 backslashes it is handled as an escape removing 1
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-11231@lists.php.net to get a copy of this message
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

« previous php.pear.bugs (#11231) next »