File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -371,16 +371,18 @@ public function process($item) {
371371 array_pop (SSViewer::$ topLevel );
372372
373373 if (isset ($ _GET ['debug_profile ' ])) Profiler::unmark ("SSViewer::process " , " for $ template " );
374-
374+
375375 // If we have our crazy base tag, then fix # links referencing the current page.
376- if (strpos ($ output , '<base ' ) !== false ) {
377- if (SSViewer::$ options ['rewriteHashlinks ' ] === 'php ' ) {
378- $ thisURLRelativeToBase = "<?php echo strip_tags( \$_SERVER['REQUEST_URI']); ?> " ;
379- } else {
380- $ thisURLRelativeToBase = strip_tags ($ _SERVER ['REQUEST_URI ' ]);
376+ if (SSViewer::$ options ['rewriteHashlinks ' ]) {
377+ if (strpos ($ output , '<base ' ) !== false ) {
378+ if (SSViewer::$ options ['rewriteHashlinks ' ] === 'php ' ) {
379+ $ thisURLRelativeToBase = "<?php echo strip_tags( \$_SERVER['REQUEST_URI']); ?> " ;
380+ } else {
381+ $ thisURLRelativeToBase = strip_tags ($ _SERVER ['REQUEST_URI ' ]);
382+ }
383+ $ output = preg_replace ('/(<a[^>]+href *= *)"#/i ' , '\\1" ' . $ thisURLRelativeToBase . '# ' , $ output );
381384 }
382- $ output = preg_replace ('/(<a[^>+]href *= *)"#/i ' , '\\1" ' . $ thisURLRelativeToBase . '# ' , $ output );
383- }
385+ }
384386
385387 return $ output ;
386388 }
You can’t perform that action at this time.
0 commit comments