[TYPO3-typo3org] SOLVED! Debugging results for caching issue at typo3.org

Dmitry Dulepov 9f4eetb02 at sneakemail.com
Thu Mar 15 10:16:00 CET 2007

Robert Lemke wrote:
> thanks for helping me so far. I found at least the line of code which 
> cause the problem and disabled it on typo3.org.
> The content postprocessing function prefixLocalAnchorsWithScript() in 
> tslib_fe consists of these two lines:
>     $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);
> The problem is that - at least with the HTML rendered by ter_doc_pi1 - 
> the regular expression returns an empty string therefore resulting in a 
> blank page.

The second parameter to this function is wrong. It should be '\1' and 
'\3' instead of $1 and $3. $-syntax also exists but it is used in 
different case. If ter rendering contains $ symbols, it may cause 
problems. Correct code will extract \1 and \3 and construct final string 
outside preg_replace.

Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)

More information about the TYPO3-team-typo3org mailing list