* Contain classes to list log entries
*
* Copyright © 2004 Brion Vibber <brion@pobox.com>, 2008 Aaron Schulz
- * http://www.mediawiki.org/
+ * https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Set the log reader to return only entries by the given user.
*
* @param string $name (In)valid user name
- * @return bool
+ * @return void
*/
private function limitPerformer( $name ) {
if ( $name == '' ) {
- return false;
+ return;
}
$usertitle = Title::makeTitleSafe( NS_USER, $name );
if ( is_null( $usertitle ) ) {
- return false;
+ return;
}
/* Fetch userid at first, if known, provides awesome query plan afterwards */
$userid = User::idFromName( $name );
if ( !$userid ) {
- /* It should be nicer to abort query at all,
- but for now it won't pass anywhere behind the optimizer */
- $this->mConds[] = "NULL";
+ $this->mConds['log_user_text'] = IP::sanitizeIP( $name );
} else {
$this->mConds['log_user'] = $userid;
- // Paranoia: avoid brute force searches (bug 17342)
- $user = $this->getUser();
- if ( !$user->isAllowed( 'deletedhistory' ) ) {
- $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0';
- } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
- $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_USER ) .
- ' != ' . LogPage::SUPPRESSED_USER;
- }
- $this->performer = $usertitle->getText();
}
+ // Paranoia: avoid brute force searches (bug 17342)
+ $user = $this->getUser();
+ if ( !$user->isAllowed( 'deletedhistory' ) ) {
+ $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0';
+ } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
+ $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_USER ) .
+ ' != ' . LogPage::SUPPRESSED_USER;
+ }
+
+ $this->performer = $usertitle->getText();
}
/**
*
* @param string|Title $page Title name
* @param string $pattern
- * @return bool
+ * @return void
*/
private function limitTitle( $page, $pattern ) {
global $wgMiserMode;
} else {
$title = Title::newFromText( $page );
if ( strlen( $page ) == 0 || !$title instanceof Title ) {
- return false;
+ return;
}
}