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)
Updated by Steffen Kamper almost 14 years ago
this is already fixed in trunk. Please check your version.
Updated by Saverio Vigni almost 14 years ago
just checked out trunk, it works fine thank you.