<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>yaml loader fails if string contain curly brackets</title> 
  <pubDate>Thu, 09 Apr 2026 16:54:58 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7843</link> 
  <atom:link rel="self" type="application/rss+xml" title="yaml loader fails if string contain curly brackets" href="https://bugs.horde.org/ticket/7843/rss" /> 
  <description>yaml loader fails if string contain curly brackets</description> 
 
   
   
  <item> 
   <title>Consider the following yaml snippet



---&lt;snip&gt;---

routes:</title> 
   <description>Consider the following yaml snippet



---&lt;snip&gt;---

routes:

    index:

        controller: net_nemein_news_controllers_index

        action: latest

        route: /

        content_entry_point: nnn-show-latest

        allowed_methods:

            - OPTIONS

            - GET

            - PROPFIND

    latest:

        controller: net_nemein_news_controllers_index

        action: latest

        route: &quot;/latest/{$int:number}/&quot;

        content_entry_point: nnn-show-latest

    rss:

        controller: net_nemein_news_controllers_index

        action: latest

        route: /rss.xml

        mimetype: text/xml

        template_entry_point: nnn-show-rss

    show:

        controller: net_nemein_news_controllers_article

        action: show

        route: &quot;/{$name}/&quot;

        content_entry_point: nnn-show-article

    edit:

        controller: net_nemein_news_controllers_article

        action: edit

        route: &quot;/{$name}/edit&quot;

        content_entry_point: nnn-edit-article

---&lt;snap&gt;---



This has the same bug as spyck in the parser (supposedly) thinking that the curly brackets inside strings are inline maps



syck parses this correctly even when the routes with curly brackets are not quoted.



tested on &quot;PHP 5.2.0-8+etch11 (cli)&quot; using the following code and horde/Yaml-1.0.1 via PEAR.



---&lt;snip&gt;---

&lt;?php

error_reporting(E_ALL);

require_once(&#039;Horde/Yaml.php&#039;);

require_once(&#039;Horde/Yaml/Node.php&#039;);

require_once(&#039;Horde/Yaml/Exception.php&#039;);

require_once(&#039;Horde/Yaml/Loader.php&#039;);

$path = realpath(dirname(__FILE__)) . &#039;/test.yml&#039;;

echo &quot;path={$path}\n&quot;;

$array = Horde_Yaml::load($path);

if (   !(   isset($array[&#039;routes&#039;])

         &amp;&amp; isset($array[&#039;routes&#039;][&#039;latest&#039;])

         &amp;&amp; isset($array[&#039;routes&#039;][&#039;latest&#039;][&#039;route&#039;])

         &amp;&amp; is_string($array[&#039;routes&#039;][&#039;latest&#039;][&#039;route&#039;]))

    || !(   isset($array[&#039;routes&#039;])

         &amp;&amp; isset($array[&#039;routes&#039;][&#039;show&#039;])

         &amp;&amp; isset($array[&#039;routes&#039;][&#039;show&#039;][&#039;route&#039;])

         &amp;&amp; is_string($array[&#039;routes&#039;][&#039;show&#039;][&#039;route&#039;]))

    )

{

    echo &quot;ERROR: Invalidly parsed route\n&quot;;

    var_dump($array);

    exit(1);

}



echo &quot;No  errors detected&quot;;

?&gt;

---&lt;snip&gt;---</description> 
   <pubDate>Tue, 13 Jan 2009 15:27:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7843#t51694</link> 
  </item> 
   
  <item> 
   <title>using single-quotes in stead of double-quotes works around t</title> 
   <description>using single-quotes in stead of double-quotes works around the issue on the old spyc at least (and the last time I looked you used the same code for parsing).



syck does not care about quoting or such, it &quot;just works&quot;</description> 
   <pubDate>Sat, 21 Mar 2009 11:39:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7843#t53206</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
