Mass convert NULL -> null. Left strings and comments alone, obviously.
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index 23d0788..bde712b 100644 (file)
@@ -331,6 +331,7 @@ class ApiQueryInfo extends ApiQueryBase {
                // Get normal protections for existing titles
                if(count($this->titles))
                {
+                       $this->resetQueryParams();
                        $this->addTables(array('page_restrictions', 'page'));
                        $this->addWhere('page_id=pr_page');
                        $this->addFields(array('pr_page', 'pr_type', 'pr_level',
@@ -505,8 +506,8 @@ class ApiQueryInfo extends ApiQueryBase {
        }
 
        /**
-       * Get information about watched status and put it in $watched
-       */
+        * Get information about watched status and put it in $watched
+        */
        private function getWatchedInfo()
        {
                global $wgUser;
@@ -519,12 +520,15 @@ class ApiQueryInfo extends ApiQueryBase {
 
                $lb = new LinkBatch($this->titles);
 
+               $this->resetQueryParams();
                $this->addTables(array('page', 'watchlist'));
                $this->addFields(array('page_title', 'page_namespace'));
-               $this->addWhere($lb->constructSet('page', $db));
-               $this->addWhere('wl_title=page_title');
-               $this->addWhere('wl_namespace=page_namespace');
-               $this->addWhereFld('wl_user',  $wgUser->getID());
+               $this->addWhere(array(
+                       $lb->constructSet('page', $db),
+                       'wl_namespace=page_namespace',
+                       'wl_title=page_title',
+                       'wl_user' => $wgUser->getID()
+               ));
 
                $res = $this->select(__METHOD__);
 
@@ -536,7 +540,7 @@ class ApiQueryInfo extends ApiQueryBase {
        public function getAllowedParams() {
                return array (
                        'prop' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array (
                                        'protection',
@@ -547,7 +551,7 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'readable',
                                )),
                        'token' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array_keys($this->getTokenFunctions())
                        ),
@@ -561,7 +565,7 @@ class ApiQueryInfo extends ApiQueryBase {
                                'Which additional properties to get:',
                                ' protection   - List the protection level of each page',
                                ' talkid       - The page ID of the talk page for each non-talk page',
-                               ' watched          - List the watched status of each page',
+                               ' watched      - List the watched status of each page',
                                ' subjectid    - The page ID of the parent page for each talk page'
                        ),
                        'token' => 'Request a token to perform a data-modifying action on a page',