Issue Type: Bug Created: 2012-06-12T00:44:55.000+0000 Last Updated: 2013-01-18T13:34:57.000+0000 Status: Open Fix version(s): Reporter: Hayden King (hking) Assignee: None Tags: - Zend_Config
Related issues: Attachments:
The fix in the above ticket allows for in-line comments at the end of the value but causes a bug that prevents values with legitimate hash characters such as passwords from being read properly. Encasing the value within double or single quotes did not resolve the problem wither.
I did alter a couple of regex strings in "Zend/Config/Yaml.php" that appears to have resolved it.
<pre class="literal"> @ Line 289: // New $line = rtrim(preg_replace("/^#.*$/", "", $line)); // Old $line = rtrim(preg_replace("/#.*$/", "", $line)); @ Line 317: // New simple key: value $value = rtrim( preg_replace( "/(.*)(\s+#.*?)$/", "\\1", $m ) ); // Old simple key: value $value = rtrim(preg_replace("/#.*$/", "", $m));
This update appears to allow a hash at the beginning of the line to comment the entire line, a hash at the end of the value for an in-line comment and to allow for a hash to remain in the value when using hashes in passwords or anything else someone may want/need.
No comments to display
Have you found an issue?
See the Overview section for more details.