(hopefully) fix a warning that came up on various QueryPages.
authorArne Heizmann <timwi@users.mediawiki.org>
Tue, 10 Aug 2004 23:06:38 +0000 (23:06 +0000)
committerArne Heizmann <timwi@users.mediawiki.org>
Tue, 10 Aug 2004 23:06:38 +0000 (23:06 +0000)
includes/QueryPage.php
includes/SpecialNewpages.php

index 4952d2a..0e8cef3 100644 (file)
@@ -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 .= "<li{$attr}>{$format}</li>\n";
                }
                $dbr->freeResult( $res );
index 2d9a47a..04ab8e7 100644 (file)
@@ -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, '' );