Closed
Bug 433804
Opened 18 years ago
Closed 17 years ago
buildPlatformImage() function outputs non working javascript because html quotes are not escapes
Categories
(www.mozilla.org :: General, defect)
www.mozilla.org
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: pascalc|PTO, Assigned: sgarrity)
References
Details
The buildPlatformImage() function on the Tips in product page does not take into account single quotes in the text put into the alt attribute of images, escaped quotes in the originating php variable should be converted to html entities because we are using it into javascript and the quotes are unvoluntarily ending the javascript document.write
<?=buildPlatformImage("/$lang/img/tignish/tips/beginner-01.jpg", 'Copie d\'écran du zoom', '365', '251', 'right')?>
Generates:
document.write('<img src="/fr/img/tignish/tips/beginner-01-mac.jpg" alt="Copie d'écran du zoom" class="right" />');
while it should generate:
document.write('<img src="/fr/img/tignish/tips/beginner-01-mac.jpg" alt="Copie d'écran du zoom" class="right" />');
At first sight, in the function, the following line :
$alt = htmlspecialchars($alt, ENT_COMPAT, 'UTF-8');
should be :
$alt = htmlspecialchars($alt, ENT_QUOTES, 'UTF-8');
Comment 2•17 years ago
|
||
Thanks steven.
Assignee: nobody → steven
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Component: www.mozilla.org/firefox → www.mozilla.org
Updated•13 years ago
|
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in
before you can comment on or make changes to this bug.
Description
•