r66612 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66611‎ | r66612 | r66613 >
Date:16:03, 18 May 2010
Author:devunt
Status:reverted (Comments)
Tags:
Comment:
New Extension
Modified paths:
  • /trunk/extensions/Username/Username.php (added) (history)

Diff [purge]

Index: trunk/extensions/Username/Username.php
@@ -0,0 +1,21 @@
 2+<?php
 3+
 4+
 5+$wgHooks['ParserFirstCallInit'][] = 'efUsernameParserInit';
 6+
 7+function efUsernameParserInit( &$parser ) {
 8+ $parser->setHook( 'username', 'efUsernameRender' );
 9+ return true;
 10+}
 11+
 12+function efUsernameRender( $input, $args, $parser, $frame ) {
 13+ // Nothing exciting here, just escape the user-provided
 14+ // input and throw it back out again
 15+ //return htmlspecialchars( $input );
 16+ global $wgUser;
 17+ if (!$wgUser->isLoggedIn())
 18+ {
 19+ return ($input==null)?"너":$input;
 20+ }
 21+ else return $wgUser->getName();
 22+}
Property changes on: trunk/extensions/Username/Username.php
___________________________________________________________________
Name: svn:eol-style
123 + native

Comments

#Comment by Raymond (talk | contribs)   16:30, 18 May 2010

Could you please explain what this extension does? Under which circumstances it is useful?

return ($input==null)?"너":$input;

Contains a asian (korean?) character. What does it mean? Shouldn't it be English and localized via an i18n file?

#Comment by MaxSem (talk | contribs)   18:25, 18 May 2010

This extension screws up on cached wikis, displaying the name of the user who visited that page a week ago and so on.

#Comment by Platonides (talk | contribs)   20:42, 18 May 2010

I suggest to remove it in favor of http://www.mediawiki.org/wiki/Extension:UserFunctions

#Comment by *devunt (talk | contribs)   00:10, 19 May 2010

ok. I delete it. [Extension:UserFunctions] is good one.

Status & tagging log