Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62229


Change subject: (bug 48071) API: Fix setnotificationtimestamp with no pages 
given
......................................................................

(bug 48071) API: Fix setnotificationtimestamp with no pages given

When newerthanrevid or torevid is used and no pages are given, do not
throw a fatal PHP error.

Bug: 48071
Change-Id: I5abcdf0fa20486f1198d1cc111461b3088a311df
---
M RELEASE-NOTES-1.22
M includes/api/ApiSetNotificationTimestamp.php
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/62229/1

diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index ff9622a..ebf125b 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -102,6 +102,8 @@
   stored in the database.
 * (bug 47219) Allow specifying change type of Wikipedia feed items
 * prop=imageinfo now allows setting iiurlheight without setting iiurlwidth
+* (bug 48071) action=setnotificationtimestamp no longer throws a PHP error when
+  no pages are given for newerthanrevid and torevid.
 
 === Languages updated in 1.22===
 
diff --git a/includes/api/ApiSetNotificationTimestamp.php 
b/includes/api/ApiSetNotificationTimestamp.php
index 53affbd..b75ae91 100644
--- a/includes/api/ApiSetNotificationTimestamp.php
+++ b/includes/api/ApiSetNotificationTimestamp.php
@@ -60,7 +60,7 @@
                }
 
                if ( isset( $params['torevid'] ) ) {
-                       if ( $params['entirewatchlist'] || 
$pageSet->getGoodTitleCount() > 1 ) {
+                       if ( $params['entirewatchlist'] || 
$pageSet->getGoodTitleCount() !== 1 ) {
                                $this->dieUsage( 'torevid may only be used with 
a single page', 'multpages' );
                        }
                        $title = reset( $pageSet->getGoodTitles() );
@@ -71,7 +71,7 @@
                                $timestamp = null;
                        }
                } elseif ( isset( $params['newerthanrevid'] ) ) {
-                       if ( $params['entirewatchlist'] || 
$pageSet->getGoodTitleCount() > 1 ) {
+                       if ( $params['entirewatchlist'] || 
$pageSet->getGoodTitleCount() !== 1 ) {
                                $this->dieUsage( 'newerthanrevid may only be 
used with a single page', 'multpages' );
                        }
                        $title = reset( $pageSet->getGoodTitles() );

-- 
To view, visit https://gerrit.wikimedia.org/r/62229
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5abcdf0fa20486f1198d1cc111461b3088a311df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to