From: Rob Church Date: Thu, 12 Jan 2006 20:50:33 +0000 (+0000) Subject: Slightly dirty hack to avoid a fatal PHP error when changing sig. I'll need to rethin... X-Git-Tag: 1.6.0~589 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=3b1eb3525993059ed121c4e9dc721f5be5defea6;p=lhc%2Fweb%2Fwiklou.git Slightly dirty hack to avoid a fatal PHP error when changing sig. I'll need to rethink this bit in SpecialPreferences, though. --- 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;