using wgOut->parseInline for signature preview in preferences. following r54454
authorTobias <churchofemacs@users.mediawiki.org>
Fri, 7 Aug 2009 14:44:32 +0000 (14:44 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Fri, 7 Aug 2009 14:44:32 +0000 (14:44 +0000)
includes/Preferences.php

index 308a9c2..9553a40 100644 (file)
@@ -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 <p> created by the parser (looks better without <p>)
-               if( preg_match( '/^<p>(.*)\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'] =