Account for unset visiting watchers
authorFederico Leva <federicoleva@tiscali.it>
Wed, 1 Jul 2015 12:27:55 +0000 (14:27 +0200)
committerFederico Leva <federicoleva@tiscali.it>
Wed, 1 Jul 2015 13:18:22 +0000 (15:18 +0200)
Followup to 09a21c4af8dd53644edd31fe731638b60f91594a
Now with `|| $user->isAllowed( 'unwatchedpages' )` we can enter
line 337 without having any count to show.

Change-Id: I6826e1c59899d2c8cbbc6d079874d0d583f8783a

includes/actions/InfoAction.php

index 6d43ec5..0c1a344 100644 (file)
@@ -328,7 +328,10 @@ class InfoAction extends FormlessAction {
                                $this->msg( 'pageinfo-watchers' ),
                                $lang->formatNum( $pageCounts['watchers'] )
                        );
-                       if ( $config->get( 'ShowUpdatedMarker' ) ) {
+                       if (
+                               $config->get( 'ShowUpdatedMarker' ) &&
+                               isset( $pageCounts['visitingWatchers'] )
+                       ) {
                                $minToDisclose = $config->get( 'UnwatchedPageSecret' );
                                if ( $pageCounts['visitingWatchers'] > $minToDisclose ||
                                        $user->isAllowed( 'unwatchedpages' ) ) {