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
@ -3699,10 +3699,16 @@ class SSTemplateParser extends Parser {
|
||||
*/
|
||||
function Text__finalise(&$res) {
|
||||
$text = $res['text'];
|
||||
|
||||
// TODO: This is _super_ ugly, and a performance killer to boot.
|
||||
|
||||
$text = preg_replace(
|
||||
'/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
|
||||
);
|
||||
|
||||
|
@ -858,10 +858,16 @@ class SSTemplateParser extends Parser {
|
||||
*/
|
||||
function Text__finalise(&$res) {
|
||||
$text = $res['text'];
|
||||
|
||||
// TODO: This is _super_ ugly, and a performance killer to boot.
|
||||
|
||||
$text = preg_replace(
|
||||
'/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
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user