From 9def903d386fab79507ec163da867fbbc504c14c Mon Sep 17 00:00:00 2001 From: Arne Heizmann Date: Tue, 10 Aug 2004 23:06:38 +0000 Subject: [PATCH] (hopefully) fix a warning that came up on various QueryPages. --- includes/QueryPage.php | 3 ++- includes/SpecialNewpages.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 4952d2a719..0e8cef3637 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -148,7 +148,8 @@ class QueryPage { # 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 .= "{$format}\n"; } $dbr->freeResult( $res ); diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index 2d9a47a650..04ab8e7c1a 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -59,8 +59,9 @@ class NewPagesPage extends QueryPage { # 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, '' ); -- 2.20.1