ZF-12277: Zend_Config_Yaml does not support null value
Description
http://www.yaml.org/spec/1.2/spec.html#id2803362 Probably this patch fixes:
diff --git a/Config/Yaml.php b/Config/Yaml.php
index 5f5ba84..c0b1c36 100755
--- a/Config/Yaml.php
+++ b/Config/Yaml.php
@@ -320,6 +320,8 @@ class Zend_Config_Yaml extends Zend_Config
$value = true;
} elseif (preg_match('/^(f(alse)?|off|n(o)?)$/i', $value)) {
$value = false;
+ } elseif (preg_match('/^null$/i', $value)) {
+ $value = null;
} elseif (!self::$_ignoreConstants) {
// test for constants
$value = self::_replaceConstants($value);
Comments
Posted by Rob Allen (rob) on 2012-06-13T19:12:13.000+0000
This needs a unit test before it can be added to the framework.
Posted by Evgeniy Makhrov (ezh) on 2012-06-13T21:35:03.000+0000
Posted by Ben Scholzen (dasprid) on 2012-06-13T22:46:31.000+0000
It surely does not make any sense to use regular expressions for a simple comparision:
How about:
Posted by Rob Allen (rob) on 2012-12-22T12:23:25.000+0000
fixed in trunk (25168) and release-1.12 (25169)