computerline1z / okapi

Automatically exported from code.google.com/p/okapi
0 stars 0 forks source link

Duplicated id values in inline codes for composite fragment in PHP filter #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When we have composite fragment such as:

array(
"activation_text_2" => "<ul>".
    "<li>xyz® aktivieren. <span class=\"redbold\">»</span> <a href=\"".$_CONFIG["site"]["default_page"]."?tpl=new_xyz\">weiter</a></li>".
    "<li>Fund melden. <span class=\"redbold\">»</span> <a href=\"".$_CONFIG["site"]["default_page"]."?tpl=found\">weiter</a></li>".
    "<li>Im Shop einkaufen. <span class=\"redbold\">»</span> <a href=\"".$_CONFIG["site"]["default_page"]."?tpl=onlineshop\">weiter</a></li></ul>"
);

we get:

<ph id="1">&lt;li></ph>xyz® aktivieren. <ph id="2">&lt;span 
class=\"redbold\"></ph>»<ph id="3">&lt;/span></ph> <ph id="4">&lt;a 
href=\"</ph><ph id="1">".$_CONFIG["site"]["default_page"]."</ph><ph 
id="5">?tpl=new_xyz\"></ph>weiter<ph id="6">&lt;/a></ph><ph 
id="7">&lt;/li></ph><ph id="5">".

    "</ph><ph id="8">&lt;li></ph>Fund melden. <ph id="9">&lt;span class=\"redbold\"></ph>»<ph id="10">&lt;/span></ph> <ph id="11">&lt;a href=\"</ph><ph id="8">".$_CONFIG["site"]["default_page"]."</ph><ph id="12">?tpl=found\"></ph>weiter<ph id="13">&lt;/a></ph><ph id="14">&lt;/li></ph><ph id="12">".

    "</ph><ph id="15">&lt;li></ph>Im Shop einkaufen. <ph id="16">&lt;span class=\"redbold\"></ph>»<ph id="17">&lt;/span></ph> <ph id="18">&lt;a href=\"</ph><ph id="15">".$_CONFIG["site"]["default_page"]."</ph><ph id="19">?tpl=onlineshop\"></ph>weiter<ph id="20">&lt;/a></ph><ph id="21">&lt;/li></ph><ph id="22">&lt;/ul></ph>

where ph id='1' is duplicated.

Original issue reported on code.google.com by yves.sav...@gmail.com on 24 Jan 2012 at 1:23

GoogleCodeExporter commented 9 years ago
This was related to not checking the id values when using TextFragment.insert().
Now if an id value already exists in the caller fragment, a new one is set.
The fix will be in the next snapshot and M16.

Original comment by yves.sav...@gmail.com on 25 Jan 2012 at 1:46