mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Reverted r83936 because it was inappropriate - only page-relative hashlinks should be rewritten
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84060 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cd73e27fe1
commit
047d17d512
@ -355,15 +355,15 @@ class SSViewer extends Object {
|
||||
|
||||
$output = $val;
|
||||
$output = Requirements::includeInHTML($template, $output);
|
||||
|
||||
|
||||
array_pop(SSViewer::$topLevel);
|
||||
|
||||
if(isset($_GET['debug_profile'])) Profiler::unmark("SSViewer::process", " for $template");
|
||||
|
||||
|
||||
// If we have our crazy base tag, then fix # links referencing the current page.
|
||||
if(strpos($output, '<base') !== false) {
|
||||
$thisURLRelativeToBase = Director::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
|
||||
$output = preg_replace('/(href=".*)#(.*")/i', '\\1' . $thisURLRelativeToBase . '#\\2', $output);
|
||||
$output = preg_replace('/(<a[^>+]href *= *)"#/i', '\\1"' . $thisURLRelativeToBase . '#', $output);
|
||||
}
|
||||
|
||||
return $output;
|
||||
@ -509,9 +509,7 @@ class SSViewer extends Object {
|
||||
$content = ereg_replace('<!-- +if_end +-->', '<? } ?>', $content);
|
||||
|
||||
// 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
|
||||
$content = ereg_replace('<\?xml([^>]+)\?' . '>', '<##xml\\1##>', $content);
|
||||
|
Loading…
Reference in New Issue
Block a user