Do not output lines for which nothing is formatted (formatResult returning false)
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Feb 2005 01:41:30 +0000 (01:41 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Feb 2005 01:41:30 +0000 (01:41 +0000)
includes/QueryPage.php

index 90954ce..335b279 100644 (file)
@@ -185,9 +185,11 @@ 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 = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
-                                                                       $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
-                               $s .= "<li{$attr}>{$format}</li>\n";
+                               if ( $format ) {
+                                       $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
+                                                                               $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
+                                       $s .= "<li{$attr}>{$format}</li>\n";
+                               }
                        }
                        $dbr->freeResult( $res );
                        $s .= '</ol>';