Project

General

Profile

Bug #17636 » tslib_prefixLocalAnchorsWithScript_requesturi_and_single_quotes_r4382.diff

Administrator Admin, 2008-10-29 15:56

View differences:

class.tslib_fe.php (Arbeitskopie)
* @return void Works directly on $this->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);
$this->content = preg_replace('/(<(?:a|area)\s[^>]*?\bhref\s*=\s*("|\'))(#[^\2]*\2)/is','${1}' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '${3}',$this->content);
}
/**
(3-3/4)