From 3b1eb3525993059ed121c4e9dc721f5be5defea6 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 12 Jan 2006 20:50:33 +0000 Subject: [PATCH] Slightly dirty hack to avoid a fatal PHP error when changing sig. I'll need to rethink this bit in SpecialPreferences, though. --- includes/Parser.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index b6af7fa922..0b3d92d13a 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3236,7 +3236,7 @@ class Parser # Sig. might contain markup; validate this if( $this->validateSig( $nickname ) !== false ) { # Validated; clean up (if needed) and return it - return( $this->cleanSig( $nickname ) ); + return( $this->cleanSig( $nickname, true ) ); } else { # Failed to validate; fall back to the default $nickname = $username; @@ -3269,7 +3269,7 @@ class Parser * @param string $text * @return string Text */ - function cleanSig( $text ) { + function cleanSig( $text, $parsing = false ) { $mw = MagicWord::get( MAG_SUBST ); $substre = $mw->getBaseRegex(); $subst = $mw->getSynonym( 0 ); @@ -3289,7 +3289,9 @@ class Parser ); $text = preg_replace( '/~{3,5}/', '', $text ); - $text = $this->replaceVariables( $text ); + if( $parsing) { + $text = $this->replaceVariables( $text ); + } return $text; -- 2.20.1