Bug #24277
closedDouble htmlspecialchars prevents load of google maps api
0%
Description
While loading the google maps api with the following typoscript:
page.includeJS {
file0 = http://maps.google.com/maps?file=api&v=2&sensor=false&key=<google api key>
file0.external = 1
}
i found that for every '&' in the url in the html source there where this string: '&', this means a double htmlspecialchars action.
In fact at line 727 of class.tslib_pagegen.php i found this:
htmlspecialchars($ss),
in $ss we have the external js to load, then this value is put into the js array.
Once the render method of the page renderer is called and the script tag is generated it passes thru anothe htmlspecialchars in line 1158 of class.t3lib_pagerenderer.php, so every '&' of the original url becomes '&' with the first htmlspecialchars call, then it becomes & with the second.
This makes the google api prompt for an invalid key every time the api is loaded.
TESTED with google chrome
I've solved the problem removing the scond htmlspecialchars, but i don't knw if there is a better way
(issue imported from #M16652)