Issue Feature Closed

#14315ampersands in url parameters are 'cleaned' by xhtml_cleaning

Nico de 09/15/04, 00:27 updated 08/12/06, 14:17

Description

If xhtml_cleaning is activated, the urls in a frameset look like src=‘index.php?id=2&type=2’ , so the second parameter is not recognized. If I deactivate xhtml_cleaning it looks like src=‘index.php?id=2&type=2’ and all is fine. So it seems. the ampersand is replaced twice.

I found postings in the forum from people having trouble with passing parameters in urls with xhtml_cleaning activated.
I could fix it, by inserting two lines in the bidir_htmlspecialchars function in class.t3lib_parsehtml.php to exclude the ampersand entity from being parsed with htmlspecialchar:

function bidir_htmlspecialchars($value,$dir) {
if ($dir>0) {
$value = str_replace(“&”,”<amp>“,$value); //replacing all &amp; with <amp> (there are no tags in the $value string<br> $value = htmlspecialchars($value);<br> $value = str_replace(“&lt;amp&gt;”,”&amp;”,$value); //putting &amp; back to it’s place<br> } elseif ($dir0) {<br> $value = str_replace("&gt;","&gt;“,$value);<br> $value = str_replace(“&lt;”,”&lt;”,$value);<br> $value = str_replace(“"”,’”’,$value);<br> $value = str_replace(“&amp;”,”&amp;”,$value);<br> }<br> return $value;<br>}<br>(issue imported from #M358)</amp></amp>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.