#14315ampersands in url parameters are 'cleaned' by xhtml_cleaning
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 & with <amp> (there are no tags in the $value string<br> $value = htmlspecialchars($value);<br> $value = str_replace(“<amp>”,”&”,$value); //putting & back to it’s place<br> } elseif ($dir0) {<br> $value = str_replace(">",">“,$value);<br> $value = str_replace(“<”,”<”,$value);<br> $value = str_replace(“"”,’”’,$value);<br> $value = str_replace(“&”,”&”,$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.