Issue Bug Closed

#16347problem with prefixLocalAnchors

Juraj Sulek 07/15/06, 13:52 updated 10/30/08, 22:50

Description

If you use prefixLocalAnchors = all and simulateStaticDocuments = 1 then the function prefixLocalAnchorsWithScript() will generate wrong code.

This is because TYPO3 will generate such links:
810.html?&parameter=parameter….

and the second preg_replace parameter is:
’$1’ . htmlspecialchars($scriptPath) . ‘$3’
which is in this case eqal to
’$1810.html?&parameter=parameter…$3’ which is wrong

the solution:
change the second parameter to this
’${1}’ . htmlspecialchars($scriptPath) . ‘$3’
then the code will be
’${1}810.html?&parameter=parameter…$3’

the function is in file: …/tslib/class.tslib_fe.php at line 3496 and the correct code is:

function prefixLocalAnchorsWithScript() {
$scriptPath = substr(t3lib_div::getIndpEnv(‘TYPO3_REQUEST_URL’),strlen(t3lib_div::getIndpEnv(‘TYPO3_SITE_URL’)));
$this->content = preg_replace(‘/(<(a|area).?href=”)(#[^”]”)/i’,’${1}’ . htmlspecialchars($scriptPath) . ‘$3’,$this->content);
}
(issue imported from #M3848)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.