Bug #20498 [Opn->Csd]: If the config contains 2 backslashes it is handled as an escape removing 1
| From: | info at pc-e dot org | Date: | Fri, 20 Feb 2015 14:44:51 +0000 |
| Subject: | Bug #20498 [Opn->Csd]: 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-11253@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
Updated by: info@pc-e.org
Reported By: amcconaughey at gmail dot com
Summary: If the config contains 2 backslashes it is handled as
an escape removing 1
-Status: Open
+Status: Closed
Type: Bug
Package: Config_Lite
Operating System: Mac and Windows
Package Version: 0.2.1
PHP Version: 5.5.21
-Assigned To:
+Assigned To: pce
Roadmap Versions:
New Comment:
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: pce
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/
use singlequotes or use the added raw scanner mode, fixed and tests in
v0.2.3
Previous Comments:
------------------------------------------------------------------------
[2015-02-03 23:12:40] alesandreo
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.
------------------------------------------------------------------------
[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