Bug #16347
closedproblem with prefixLocalAnchors
0%
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?¶meter=parameter....
and the second preg_replace parameter is:
'$1' . htmlspecialchars($scriptPath) . '$3'
which is in this case eqal to
'$1810.html?¶meter=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?¶meter=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)