Zend Framework

Zend_Config_Yaml comment should allow indented comments

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.11.6
  • Fix Version/s: 1.11.7
  • Component/s: Zend_Config
  • Labels:
    None

Description

When commenting lines in yaml-config, comments can be started only from 0-position of string, to be processed correctly (to be ignored). Otherwise, by yaml-specification, comment can be started from any position of string, and text after comment should be ignored.

The patch is only replace

if ($line[0] == '#')

Unknown macro: { // comment continue; }

in Zend_Config_Yaml to

$line = rtrim(preg_replace("/#.*$/", "", $line));

Issue Links

Activity

Hide
Rob Allen added a comment -

Assigned to author of Zend_Config_Yaml

Show
Rob Allen added a comment - Assigned to author of Zend_Config_Yaml
Hide
Adam Lundrigan added a comment - - edited

YAML specification indicates that comments can indeed be indented (see http://www.yaml.org/spec/1.2/spec.html#id2780069, Example 6.10).
I've committed a fix and unit test to resolve this issue in r24090 and r24091

Show
Adam Lundrigan added a comment - - edited YAML specification indicates that comments can indeed be indented (see http://www.yaml.org/spec/1.2/spec.html#id2780069, Example 6.10). I've committed a fix and unit test to resolve this issue in r24090 and r24091
Hide
Adam Lundrigan added a comment -

Merged to release-1.11 in r24092

Show
Adam Lundrigan added a comment - Merged to release-1.11 in r24092

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: