Merge "(bug 46059) giving #p-personal a higher z-index than #content in monobook"
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index 8ef1a97..58d5d9a 100644 (file)
@@ -44,8 +44,9 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $this->requireMaxOneParameter( $params, 'timestamp', 'torevid', 'newerthanrevid' );
 
                $pageSet = $this->getPageSet();
-               $args = array_merge( array( $params, 'entirewatchlist' ), array_keys( $pageSet->getAllowedParams() ) );
-               call_user_func_array( array( $this, 'requireOnlyOneParameter' ), $args );
+               if ( $params['entirewatchlist'] && $pageSet->getDataSource() !== null ) {
+                       $this->dieUsage( "Cannot use 'entirewatchlist' at the same time as '{$pageSet->getDataSource()}'", 'multisource' );
+               }
 
                $dbw = wfGetDB( DB_MASTER, 'api' );
 
@@ -133,6 +134,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        }
 
                        // Now, put the valid titles into the result
+                       /** @var $title Title */
                        foreach ( $pageSet->getTitles() as $title ) {
                                $ns = $title->getNamespace();
                                $dbkey = $title->getDBkey();
@@ -283,9 +285,9 @@ class ApiSetNotificationTimestamp extends ApiBase {
 
        public function getExamples() {
                return array(
-                       'api.php?action=setnotificationtimestamp&entirewatchlist=&token=ABC123' => 'Reset the notification status for the entire watchlist',
-                       'api.php?action=setnotificationtimestamp&titles=Main_page&token=ABC123' => 'Reset the notification status for "Main page"',
-                       'api.php?action=setnotificationtimestamp&titles=Main_page&timestamp=2012-01-01T00:00:00Z&token=ABC123' => 'Set the notification timestamp for "Main page" so all edits since 1 January 2012 are unviewed',
+                       'api.php?action=setnotificationtimestamp&entirewatchlist=&token=123ABC' => 'Reset the notification status for the entire watchlist',
+                       'api.php?action=setnotificationtimestamp&titles=Main_page&token=123ABC' => 'Reset the notification status for "Main page"',
+                       'api.php?action=setnotificationtimestamp&titles=Main_page&timestamp=2012-01-01T00:00:00Z&token=123ABC' => 'Set the notification timestamp for "Main page" so all edits since 1 January 2012 are unviewed',
                );
        }