mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fix href rewriting in text
This commit is contained in:
parent
31c5bb24f7
commit
08faf03673
@ -3700,9 +3700,15 @@ class SSTemplateParser extends Parser {
|
|||||||
function Text__finalise(&$res) {
|
function Text__finalise(&$res) {
|
||||||
$text = $res['text'];
|
$text = $res['text'];
|
||||||
|
|
||||||
|
// TODO: This is _super_ ugly, and a performance killer to boot.
|
||||||
|
|
||||||
$text = preg_replace(
|
$text = preg_replace(
|
||||||
'/href\s*\=\s*\"\#/',
|
'/href\s*\=\s*\"\#/',
|
||||||
'href="<?= SSViewer::{dlr}options[\'rewriteHashlinks\'] ? Convert::raw2att( {dlr}_SERVER[\'REQUEST_URI\'] ) : "" ?>#',
|
'href="' . PHP_EOL .
|
||||||
|
'SSVIEWER;' . PHP_EOL .
|
||||||
|
'$val .= SSViewer::$options[\'rewriteHashlinks\'] ? Convert::raw2att( $_SERVER[\'REQUEST_URI\'] ) : "";' . PHP_EOL .
|
||||||
|
'$val .= <<<SSVIEWER' . PHP_EOL .
|
||||||
|
'#',
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -859,9 +859,15 @@ class SSTemplateParser extends Parser {
|
|||||||
function Text__finalise(&$res) {
|
function Text__finalise(&$res) {
|
||||||
$text = $res['text'];
|
$text = $res['text'];
|
||||||
|
|
||||||
|
// TODO: This is _super_ ugly, and a performance killer to boot.
|
||||||
|
|
||||||
$text = preg_replace(
|
$text = preg_replace(
|
||||||
'/href\s*\=\s*\"\#/',
|
'/href\s*\=\s*\"\#/',
|
||||||
'href="<?= SSViewer::{dlr}options[\'rewriteHashlinks\'] ? Convert::raw2att( {dlr}_SERVER[\'REQUEST_URI\'] ) : "" ?>#',
|
'href="' . PHP_EOL .
|
||||||
|
'SSVIEWER;' . PHP_EOL .
|
||||||
|
'$val .= SSViewer::$options[\'rewriteHashlinks\'] ? Convert::raw2att( $_SERVER[\'REQUEST_URI\'] ) : "";' . PHP_EOL .
|
||||||
|
'$val .= <<<SSVIEWER' . PHP_EOL .
|
||||||
|
'#',
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user