Project

General

Profile

Actions

Bug #24277

closed

Double htmlspecialchars prevents load of google maps api

Added by Saverio Vigni almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-12-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

Actions

Also available in: Atom PDF