# Only read at most $num rows, because $res may contain the whole 1000
for ( $i = 0; $i < $num && $obj = $dbr->fetchObject( $res ); $i++ ) {
$format = $this->formatResult( $sk, $obj );
- $attr = ( $obj->usepatrol && $obj->patrolled == 0 ) ? ' class="not_patrolled"' : '';
+ $attr = ( !is_null ( $obj->usepatrol ) && $obj->usepatrol &&
+ $obj->patrolled == 0 ) ? ' class="not_patrolled"' : '';
$s .= "<li{$attr}>{$format}</li>\n";
}
$dbr->freeResult( $res );
# Since there is no diff link, we need to give users a way to
# mark the article as patrolled if it isn't already
- if ( $wgUseRCPatrol && $result->usepatrol && $result->patrolled == 0 &&
- $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
+ if ( $wgUseRCPatrol && !is_null ( $result->usepatrol ) && $result->usepatrol &&
+ $result->patrolled == 0 && $wgUser->getID() != 0 &&
+ ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
$link = $skin->makeKnownLink( $result->title, '', "rcid={$result->rcid}" );
else
$link = $skin->makeKnownLink( $result->title, '' );