X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flogging%2FLogPager.php;h=11dce31bc788822eec923fc3d24744a0ef581aab;hp=68163c13e51462014b73a0651a5faa317ad55e72;hb=82e2c924e473fa3b99bb8e0da71d99b70ec5ca07;hpb=e758226c91935a1df2b6fd3ed1f18922d8bfb45b diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 68163c13e5..11dce31bc7 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -2,7 +2,7 @@ /** * Contain classes to list log entries * - * Copyright © 2004 Brion Vibber , 2008 Aaron Schulz + * Copyright © 2004 Brion Vibber * https://www.mediawiki.org/ * * This program is free software; you can redistribute it and/or modify @@ -181,7 +181,7 @@ class LogPager extends ReverseChronologicalPager { } else { $this->mConds['log_user'] = $userid; } - // Paranoia: avoid brute force searches (bug 17342) + // Paranoia: avoid brute force searches (T19342) $user = $this->getUser(); if ( !$user->isAllowed( 'deletedhistory' ) ) { $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0'; @@ -256,7 +256,7 @@ class LogPager extends ReverseChronologicalPager { } else { $this->mConds['log_title'] = $title->getDBkey(); } - // Paranoia: avoid brute force searches (bug 17342) + // Paranoia: avoid brute force searches (T19342) $user = $this->getUser(); if ( !$user->isAllowed( 'deletedhistory' ) ) { $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION ) . ' = 0'; @@ -305,14 +305,13 @@ class LogPager extends ReverseChronologicalPager { $options = $basic['options']; $joins = $basic['join_conds']; - $index = []; # Add log_search table if there are conditions on it. # This filters the results to only include log rows that have # log_search records with the specified ls_field and ls_value values. if ( array_key_exists( 'ls_field', $this->mConds ) ) { $tables[] = 'log_search'; - $index['log_search'] = 'ls_field_val'; - $index['logging'] = 'PRIMARY'; + $options['IGNORE INDEX'] = [ 'log_search' => 'ls_log_id' ]; + $options['USE INDEX'] = [ 'logging' => 'PRIMARY' ]; if ( !$this->hasEqualsClause( 'ls_field' ) || !$this->hasEqualsClause( 'ls_value' ) ) { @@ -322,9 +321,6 @@ class LogPager extends ReverseChronologicalPager { $options[] = 'DISTINCT'; } } - if ( count( $index ) ) { - $options['USE INDEX'] = $index; - } # Don't show duplicate rows when using log_search $joins['log_search'] = [ 'INNER JOIN', 'ls_log_id=log_id' ];