Index: typo3/sysext/cms/tslib/class.tslib_fe.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_fe.php (revision 2937)
+++ typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
@@ -3725,11 +3725,17 @@
/**
* Substitutes all occurencies of content with content
+ * @return void The substituted content.
*/
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);
+ $original_content = $this->content;
+ $this->content = preg_replace('/(<(a|area).+href=")(#[^"]*")/i','${1}' . htmlspecialchars($scriptPath) . '${3}',$original_content);
+ if(preg_last_error()>0) {
+ //The was an error in call to preg_replace, so keep original content (Behavior prior t PHP 5.2).
+ t3lib_div::sysLog('preg_replace returned error-code: ' . preg_last_error().' in function prefixLocalAnchorsWithScript. Replacement not done!' , 'cms', 4);
+ $this->content = $original_content;
+ }
}
/**