r44920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44919‎ | r44920 | r44921 >
Date:00:33, 23 December 2008
Author:mrzman
Status:ok
Tags:
Comment:
(bug 16764) Fix case-sensitivity and underscores in username input by creating a user object and getting the name rather than using the input directly.
Modified paths:
  • /trunk/extensions/Oversight/HideRevision_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Oversight/HideRevision_body.php
@@ -606,7 +606,12 @@
607607 $this->namespace = $title ? $title->getNamespace() : -1;
608608 $this->dbKey = $title ? $title->getDBKey() : null;
609609 $this->uid = $user ? $user->getId() : null;
610 - $this->author = strlen($offender) ? $offender : null;
 610+ if ( strlen($offender) ) {
 611+ $offender = User::newFromName( $offender );
 612+ $this->author = is_null( $offender ) ? '' : $offender->getName();
 613+ } else {
 614+ $this->author = null;
 615+ }
611616
612617 parent::__construct();
613618 }

Status & tagging log