mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR fix rewrite of anchors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@83936 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bd28434884
commit
cd73e27fe1
@ -363,7 +363,7 @@ class SSViewer extends Object {
|
|||||||
// If we have our crazy base tag, then fix # links referencing the current page.
|
// If we have our crazy base tag, then fix # links referencing the current page.
|
||||||
if(strpos($output, '<base') !== false) {
|
if(strpos($output, '<base') !== false) {
|
||||||
$thisURLRelativeToBase = Director::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
|
$thisURLRelativeToBase = Director::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
|
||||||
$output = preg_replace('/(<a[^>+]href *= *)"#/i', '\\1"' . $thisURLRelativeToBase . '#', $output);
|
$output = preg_replace('/(href=".*)#(.*")/i', '\\1' . $thisURLRelativeToBase . '#\\2', $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
@ -509,7 +509,9 @@ class SSViewer extends Object {
|
|||||||
$content = ereg_replace('<!-- +if_end +-->', '<? } ?>', $content);
|
$content = ereg_replace('<!-- +if_end +-->', '<? } ?>', $content);
|
||||||
|
|
||||||
// Fix link stuff
|
// Fix link stuff
|
||||||
|
/*
|
||||||
$content = ereg_replace('href *= *"#', 'href="<?= SSViewer::$options[\'rewriteHashlinks\'] ? Convert::raw2att( $_SERVER[\'REQUEST_URI\'] ) : "" ?>#', $content);
|
$content = ereg_replace('href *= *"#', 'href="<?= SSViewer::$options[\'rewriteHashlinks\'] ? Convert::raw2att( $_SERVER[\'REQUEST_URI\'] ) : "" ?>#', $content);
|
||||||
|
*/
|
||||||
|
|
||||||
// Protect xml header
|
// Protect xml header
|
||||||
$content = ereg_replace('<\?xml([^>]+)\?' . '>', '<##xml\\1##>', $content);
|
$content = ereg_replace('<\?xml([^>]+)\?' . '>', '<##xml\\1##>', $content);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user