Merge "Don't match HTML entities in language conversion syntax"
[lhc/web/wiklou.git] / includes / logging / LogPager.php
index 5ffad43..09ae3b8 100644 (file)
@@ -34,14 +34,14 @@ class LogPager extends ReverseChronologicalPager {
        /**
         * Constructor
         *
-        * @param $list LogEventsList
+        * @param LogEventsList $list
         * @param string $types or Array: log types to show
         * @param string $performer the user who made the log entries
         * @param string|Title $title the page title the log entries are for
         * @param string $pattern do a prefix search rather than an exact title match
         * @param array $conds extra conditions for the query
-        * @param $year Integer: the year to start from
-        * @param $month Integer: the month to start from
+        * @param int $year The year to start from
+        * @param int $month The month to start from
         * @param string $tagFilter tag
         */
        public function __construct( $list, $types = array(), $performer = '', $title = '', $pattern = '',
@@ -212,9 +212,9 @@ class LogPager extends ReverseChronologicalPager {
                // Paranoia: avoid brute force searches (bug 17342)
                $user = $this->getUser();
                if ( !$user->isAllowed( 'deletedhistory' ) ) {
-                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION) . ' = 0';
+                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION ) . ' = 0';
                } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
-                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION) .
+                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION ) .
                                ' != ' . LogPage::SUPPRESSED_ACTION;
                }
        }
@@ -249,20 +249,10 @@ class LogPager extends ReverseChronologicalPager {
                                # no duplicate log rows. Otherwise, we need to remove the duplicates.
                                $options[] = 'DISTINCT';
                        }
-               # Avoid usage of the wrong index by limiting
-               # the choices of available indexes. This mainly
-               # avoids site-breaking filesorts.
-               } elseif ( $this->title || $this->pattern || $this->performer ) {
-                       $index['logging'] = array( 'page_time', 'user_time' );
-                       if ( count( $this->types ) == 1 ) {
-                               $index['logging'][] = 'log_user_type_time';
-                       }
-               } elseif ( count( $this->types ) == 1 ) {
-                       $index['logging'] = 'type_time';
-               } else {
-                       $index['logging'] = 'times';
                }
-               $options['USE INDEX'] = $index;
+               if ( count( $index ) ) {
+                       $options['USE INDEX'] = $index;
+               }
                # Don't show duplicate rows when using log_search
                $joins['log_search'] = array( 'INNER JOIN', 'ls_log_id=log_id' );