Project

General

Profile

Bug #19574 » typo3_trunk_9741.patch

Administrator Admin, 2008-12-03 12:57

View differences:

typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
* @return void Works directly on $this->content
*/
function prefixLocalAnchorsWithScript() {
$scriptPath = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
$scriptPath = $GLOBALS['TSFE']->absRefPrefix . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
$originalContent = $this->content;
$this->content = preg_replace('/(<(?:a|area).*?href=")(#[^"]*")/i', '${1}' . htmlspecialchars($scriptPath) . '${2}', $originalContent);
// There was an error in the call to preg_replace, so keep the original content (behavior prior to PHP 5.2)
typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
if (!$type) $type = 'text/javascript';
$GLOBALS['TSFE']->content.='
<script src="'.htmlspecialchars($ss).'" type="'.htmlspecialchars($type).'"></script>';
<script src="' . htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss) . '" type="' . htmlspecialchars($type) . '"></script>';
}
}
}
(7-7/7)