X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiPageSet.php;h=b321c7d14cea261cafc884da3424572605a9fcd8;hp=4ffe873ccf880544e18904dfabaecf0b70c03c02;hb=c13fee87d42bdd6fdf6764edb6f6475c14c27749;hpb=70d9fbb0bfacaf837b7e8efb3770245d646ab522 diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 4ffe873ccf..b321c7d14c 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -760,7 +760,7 @@ class ApiPageSet extends ApiBase { $linkCache = MediaWikiServices::getInstance()->getLinkCache(); $linkCache->addGoodLinkObjFromRow( $title, $row ); - $pageId = intval( $row->page_id ); + $pageId = (int)$row->page_id; $this->mAllPages[$row->page_namespace][$row->page_title] = $pageId; $this->mTitles[] = $title; @@ -869,7 +869,7 @@ class ApiPageSet extends ApiBase { $usernames = []; if ( $res ) { foreach ( $res as $row ) { - $pageId = intval( $row->page_id ); + $pageId = (int)$row->page_id; // Remove found page from the list of remaining items if ( isset( $remaining ) ) { @@ -953,8 +953,8 @@ class ApiPageSet extends ApiBase { // Get pageIDs data from the `page` table $res = $db->select( $tables, $fields, $where, __METHOD__ ); foreach ( $res as $row ) { - $revid = intval( $row->rev_id ); - $pageid = intval( $row->rev_page ); + $revid = (int)$row->rev_id; + $pageid = (int)$row->rev_page; $this->mGoodRevIDs[$revid] = $pageid; $this->mLiveRevIDs[$revid] = $pageid; $pageids[$pageid] = ''; @@ -977,7 +977,7 @@ class ApiPageSet extends ApiBase { $res = $db->select( $tables, $fields, $where, __METHOD__ ); $titles = []; foreach ( $res as $row ) { - $revid = intval( $row->ar_rev_id ); + $revid = (int)$row->ar_rev_id; $titles[$revid] = Title::makeTitle( $row->ar_namespace, $row->ar_title ); unset( $remaining[$revid] ); } @@ -1068,7 +1068,7 @@ class ApiPageSet extends ApiBase { __METHOD__ ); foreach ( $res as $row ) { - $rdfrom = intval( $row->rd_from ); + $rdfrom = (int)$row->rd_from; $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText(); $to = Title::makeTitle( $row->rd_namespace, @@ -1398,10 +1398,10 @@ class ApiPageSet extends ApiBase { $data[$toPageId], $this->mGeneratorData[$fromNs][$fromDBkey] ); - if ( $result instanceof ApiResult ) { - if ( !$result->addValue( $path, $toPageId, $data[$toPageId], ApiResult::OVERRIDE ) ) { - return false; - } + if ( $result instanceof ApiResult && + !$result->addValue( $path, $toPageId, $data[$toPageId], ApiResult::OVERRIDE ) + ) { + return false; } } }