$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";
}
$this->message['revdel-restore'],
array(),
array(
- 'target' => $title->getPrefixedUrl(),
+ 'target' => $title->getPrefixedText(),
'type' => $key,
'ids' => $query
),
$this->message['revdel-restore'],
array(),
array(
- 'target' => $title->getPrefixedUrl(),
+ 'target' => $title->getPrefixedText(),
'type' => 'logging',
'ids' => $query
),
$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();
}
}
// 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';
}
}
# 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 ) {