Project

General

Profile

Actions

Bug #16347

closed

problem with prefixLocalAnchors

Added by Juraj Sulek almost 18 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
-
Start date:
2006-07-15
Due date:
% Done:

0%

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

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)


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #18694: config.prefixLocalAnchors = all destroys links when $scriptPath starts with a numberClosedIngo Renner2008-04-24

Actions
Actions #1

Updated by Daniel Hahler over 15 years ago

Fixed in TYPO3_4-2, where both $1 and $3 are enclosed in curly braces.
(Duplicate of bug 0008240).

Please close this bug.

Actions

Also available in: Atom PDF