Issues

ZF-11172: string with zero("0") not interpreted as string in zend_config_yaml

Description

if i write in yaml file this: {quote} examplevalue: 0 {quote}

then yaml parser(Zend/Config/Yaml.php) interpreted this value as string(0) "" it's probles to write string(0) "" into yaml configuration file

this can be fixed whith replace: {quote} if (preg_match("/(\w+):\s(.)/", $line, $m)) { // key: value if ($m[2]) { {quote} to {quote} if (preg_match("/(\w+):\s(.)/", $line, $m)) { // key: value if ($m[2] || $m[2]==="0") { {quote} in file Zend/Config/Yaml.php

Comments

Simpler and more lenient is a check for strlen($m[2]). I've corrected this in the ZF2 repository, and will backport it to ZF1 for the next release.

Fixed in trunk, 1.11 release branch, and ZF2 master.