Project

General

Profile

Actions

Bug #22246

closed

wrong coding of ampersand in includeCSS and includeJS*

Added by Bernd Wilke over 14 years ago. Updated over 9 years ago.

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

0%

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

Description

trying to include a php-generated variable css file with multiple GET-parameters produces an URL with '&' instead of '&'.
the called PHP gets wrong GET-parameters.

using this typoscript:
page {
includeCSS {
varcss = fileadmin/css/csscalc.php?col1=ff0000&col2=0000ff
// neccessary for include without check for existence
// as the paramters does not belong to the filename:
varcss.external = 1
:
}
:
}

the resulting HTML is:
<link rel="stylesheet" type="text/css" href="fileadmin/css/csscalc.php?col1=ff0000&col2=0000ff" media="screen" />

inside the php a call to 'print_r($_GET)' showes the wrong parameters:
GET=Array
(
[col1] => ff0000
[amp;col2] => 0000ff
)

the same may occur with includeJS*

looking in the source of V4.3.2 I found in class.tslib_pagegen.php at line 546 the functioncall htmlspecialchars() which changes the '&' into '&'

I think this should not be called. At least if external is true.

this may be fixed for CSS by changing only this line to
$GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['external'] ? $ss : htmlspecialchars($ss) ,
(for my needs it worked)

maybe some more lines have to be changed.
and please check for similar uses with includeJS*.
(issue imported from #M13757)

Actions #1

Updated by Arjen Hoekema over 14 years ago

This is still a problem in TYPO3 v4.3.3. All JS/CSS includes that are defined in the PAGE object are double htmlspecialchar'ed, once in the "t3lib_pageRenderer" and again in "class.tslib_pagegen.php".

Actions #2

Updated by Marc Bastian Heinrichs almost 14 years ago

Jep, same problem with includeJS under 4.4

Actions #3

Updated by Xavier Perseguers almost 13 years ago

  • Category deleted (Communication)
  • Assignee deleted (Steffen Kamper)
  • Target version deleted (0)
Actions #4

Updated by Alexander Opitz almost 10 years ago

  • Status changed from Accepted to Needs Feedback
  • Is Regression set to No

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?

Actions #5

Updated by Alexander Opitz over 9 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF