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

Issue Type: Bug Created: 2011-03-15T02:34:49.000+0000 Last Updated: 2011-03-16T21:33:33.000+0000 Status: Resolved Fix version(s): - 1.11.5 (07/Apr/11)

  • Next Major Release ()

Reporter: Anton Eskin (cramen) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Config

Related issues: Attachments:


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


Posted by Matthew Weier O'Phinney (matthew) on 2011-03-16T19:56:13.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2011-03-16T21:33:33.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.