r54584 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54583‎ | r54584 | r54585 >
Date:14:44, 7 August 2009
Author:churchofemacs
Status:ok
Tags:
Comment:
using wgOut->parseInline for signature preview in preferences. following r54454
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Preferences.php
@@ -291,20 +291,17 @@
292292 );
293293 }
294294
295 - global $wgMaxSigChars, $wgParser;
 295+ global $wgMaxSigChars, $wgOut, $wgParser;
296296
297297 // show a preview of the old signature first
298 - $oldsigtext = $wgParser->preSaveTransform( "~~~", new Title , $user, new ParserOptions );
299 - $oldsig = $wgParser->parse( $oldsigtext, new Title , new ParserOptions );
300 - $m = array(); // remove <p> created by the parser (looks better without <p>)
301 - if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $oldsig->mText, $m ) ) $oldsig->mText = $m[1];
302 -
 298+ $oldsigWikiText = $wgParser->preSaveTransform( "~~~", new Title , $user, new ParserOptions );
 299+ $oldsigHTML = $wgOut->parseInline( $oldsigWikiText );
303300 $defaultPreferences['oldsig'] =
304301 array(
305302 'type' => 'info',
306303 'raw' => true,
307304 'label-message' => 'tog-oldsig',
308 - 'default' => $oldsig->mText,
 305+ 'default' => $oldsigHTML,
309306 'section' => 'personal/signature',
310307 );
311308 $defaultPreferences['nickname'] =

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54454Adding signature preview on Special:Preferences and introducing help text for...churchofemacs14:45, 5 August 2009

Status & tagging log