Use (int) rather than intval()
[lhc/web/wiklou.git] / includes / api / ApiQueryIWBacklinks.php
index a10ba16..b015223 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * API for MediaWiki 1.17+
  *
- * Created on May 14, 2010
- *
  * Copyright © 2010 Sam Reed
  * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
@@ -44,7 +42,7 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
        }
 
        /**
-        * @param ApiPageSet $resultPageSet
+        * @param ApiPageSet|null $resultPageSet
         * @return void
         */
        public function run( $resultPageSet = null ) {
@@ -69,7 +67,7 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
                        $op = $params['dir'] == 'descending' ? '<' : '>';
                        $prefix = $db->addQuotes( $cont[0] );
                        $title = $db->addQuotes( $cont[1] );
-                       $from = intval( $cont[2] );
+                       $from = (int)$cont[2];
                        $this->addWhere(
                                "iwl_prefix $op $prefix OR " .
                                "(iwl_prefix = $prefix AND " .
@@ -133,7 +131,7 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
                        if ( !is_null( $resultPageSet ) ) {
                                $pages[] = Title::newFromRow( $row );
                        } else {
-                               $entry = [ 'pageid' => $row->page_id ];
+                               $entry = [ 'pageid' => (int)$row->page_id ];
 
                                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
                                ApiQueryBase::addTitleInfo( $entry, $title );