Fix log type and name in revdeleted messages: suppressions are stored in the suppress...
[lhc/web/wiklou.git] / includes / LogEventsList.php
index 3739304..c1dbe43 100644 (file)
@@ -108,11 +108,22 @@ class LogEventsList {
                $links = array();
                $hiddens = ''; // keep track for "go" button
                foreach( $filter as $type => $val ) {
+                       // Should the below assignment be outside the foreach?
+                       // Then it would have to be copied. Not certain what is more expensive.
+                       $query = $this->getDefaultQuery();
+                       $queryKey = "hide_{$type}_log";
+                       $query[$queryKey] = $hideVal;
+
                        $hideVal = 1 - intval($val);
-                       // FIXME: use link() here. Needs changes in getDefaultQuery()
-                       $link = $this->skin->makeKnownLinkObj( $wgTitle, $messages[$hideVal],
-                               wfArrayToCGI( array( "hide_{$type}_log" => $hideVal ), $this->getDefaultQuery() )
+
+                       $link = $this->skin->link(
+                               $wgTitle,
+                               $messages[$hideVal],
+                               array(),
+                               $query,
+                               array( 'known', 'noclasses' )
                        );
+
                        $links[$type] = wfMsgHtml( "log-show-hide-{$type}", $link );
                        $hiddens .= Xml::hidden( "hide_{$type}_log", $val ) . "\n";
                }
@@ -356,7 +367,7 @@ class LogEventsList {
                                        $this->message['revdel-restore'],
                                        array(),
                                        array(
-                                               'target' => $title->getPrefixedUrl(),
+                                               'target' => $title->getPrefixedText(),
                                                'type' => $key,
                                                'ids' => $query
                                        ),
@@ -378,7 +389,7 @@ class LogEventsList {
                                        $this->message['revdel-restore'], 
                                        array(),
                                        array(
-                                               'target' => $title->getPrefixedUrl(),
+                                               'target' => $title->getPrefixedText(),
                                                'type' => 'logging',
                                                'ids' => $query
                                        ),
@@ -670,7 +681,7 @@ class LogPager extends ReverseChronologicalPager {
                        $this->mConds['log_user'] = $userid;
                        // Paranoia: avoid brute force searches (bug 17342)
                        if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
-                               $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_USER . ' = 0';
+                               $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_USER) . ' = 0';
                        }
                        $this->user = $usertitle->getText();
                }
@@ -714,7 +725,7 @@ class LogPager extends ReverseChronologicalPager {
                }
                // Paranoia: avoid brute force searches (bug 17342)
                if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
-                       $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_ACTION . ' = 0';
+                       $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_ACTION) . ' = 0';
                }
        }
 
@@ -725,7 +736,7 @@ class LogPager extends ReverseChronologicalPager {
                # Add log_search table if there are conditions on it
                if( array_key_exists('ls_field',$this->mConds) ) {
                        $tables[] = 'log_search';
-                       $index = array( 'log_search' => 'PRIMARY', 'logging' => 'PRIMARY' );
+                       $index = array( 'log_search' => 'ls_field_val', 'logging' => 'PRIMARY' );
                        $groupBy = 'ls_log_id';
                # Don't use the wrong logging index
                } else if( $this->title || $this->pattern || $this->user ) {