From 6df30513dd7510b031f790bbff5119c0f36e145a Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 7 Aug 2009 14:44:32 +0000 Subject: [PATCH] using wgOut->parseInline for signature preview in preferences. following r54454 --- includes/Preferences.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/includes/Preferences.php b/includes/Preferences.php index 308a9c2eaf..9553a401ae 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -291,20 +291,17 @@ class Preferences { ); } - global $wgMaxSigChars, $wgParser; + global $wgMaxSigChars, $wgOut, $wgParser; // show a preview of the old signature first - $oldsigtext = $wgParser->preSaveTransform( "~~~", new Title , $user, new ParserOptions ); - $oldsig = $wgParser->parse( $oldsigtext, new Title , new ParserOptions ); - $m = array(); // remove

created by the parser (looks better without

) - if( preg_match( '/^

(.*)\n?<\/p>\n?$/sU', $oldsig->mText, $m ) ) $oldsig->mText = $m[1]; - + $oldsigWikiText = $wgParser->preSaveTransform( "~~~", new Title , $user, new ParserOptions ); + $oldsigHTML = $wgOut->parseInline( $oldsigWikiText ); $defaultPreferences['oldsig'] = array( 'type' => 'info', 'raw' => true, 'label-message' => 'tog-oldsig', - 'default' => $oldsig->mText, + 'default' => $oldsigHTML, 'section' => 'personal/signature', ); $defaultPreferences['nickname'] = -- 2.20.1