r100865 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100864‎ | r100865 | r100866 >
Date:20:36, 26 October 2011
Author:petrb
Status:deferred (Comments)
Tags:
Comment:
better way to get page owner
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -90,7 +90,8 @@
9191 $ns = $article->getTitle()->getNamespace();
9292 if ( ( $ns == NS_USER_TALK ) || ( $ns == NS_USER ) ) {
9393 // better way to get a username would be great :)
94 - $user = preg_replace( '/\/.*/', '', preg_replace( '/^.*\:/', "", $article->getTitle() ) );
 94+ $user = $article->getTitle();
 95+ $user = preg_replace( '/\/.*/', '', substr($user, strpos($user, ":") + 1));
9596 if ( OnlineStatusBar::IsValid( $user ) ) {
9697 $mode = OnlineStatusBar::GetStatus( $user );
9798 $modetext = $wgOnlineStatusBarModes[$mode];

Follow-up revisions

RevisionCommit summaryAuthorDate
r100956implement new variable {{isonline}} which can be used toopetrb07:59, 27 October 2011
r100973removed tolower, per comments on previous revpetrb13:26, 27 October 2011

Comments

#Comment by Nikerabbit (talk | contribs)   06:29, 27 October 2011

Um. getTitle() returns a Title object, not a string. You can get the page name without namespace easily with $title->getText().

#Comment by Petrb (talk | contribs)   13:31, 27 October 2011

it's already replaced with new function

#Comment by Petrb (talk | contribs)   17:20, 28 October 2011

it's already fixed... bump

Status & tagging log