X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryInfo.php;h=eee5daef65b0ce0cc9fb8537217f7e4d1876e0bf;hb=b51076a84446d157bed511246450e70d26e0f945;hp=5af44eea2173c9a289400d8235bb464cb3f22bd6;hpb=a82f0fcb6898faf0d3ff62c6e47a777985f0f3d6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 5af44eea21..eee5daef65 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -395,10 +395,10 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['length'] = intval( $this->pageLength[$pageid] ); if ( isset( $this->pageIsRedir[$pageid] ) && $this->pageIsRedir[$pageid] ) { - $pageInfo['redirect'] = ''; + $pageInfo['redirect'] = true; } if ( $this->pageIsNew[$pageid] ) { - $pageInfo['new'] = ''; + $pageInfo['new'] = true; } } @@ -421,18 +421,18 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['protection'] = $this->protections[$ns][$dbkey]; } - $this->getResult()->setIndexedTagName( $pageInfo['protection'], 'pr' ); + ApiResult::setIndexedTagName( $pageInfo['protection'], 'pr' ); $pageInfo['restrictiontypes'] = array(); if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) { $pageInfo['restrictiontypes'] = $this->restrictionTypes[$ns][$dbkey]; } - $this->getResult()->setIndexedTagName( $pageInfo['restrictiontypes'], 'rt' ); + ApiResult::setIndexedTagName( $pageInfo['restrictiontypes'], 'rt' ); } - if ( $this->fld_watched && isset( $this->watched[$ns][$dbkey] ) ) { - $pageInfo['watched'] = ''; + if ( $this->fld_watched ) { + $pageInfo['watched'] = isset( $this->watched[$ns][$dbkey] ); } if ( $this->fld_watchers ) { @@ -464,8 +464,8 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT ); $pageInfo['canonicalurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CANONICAL ); } - if ( $this->fld_readable && $title->userCan( 'read', $this->getUser() ) ) { - $pageInfo['readable'] = ''; + if ( $this->fld_readable ) { + $pageInfo['readable'] = $title->userCan( 'read', $this->getUser() ); } if ( $this->fld_preload ) { @@ -497,9 +497,7 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['actions'] = array(); foreach ( $this->params['testactions'] as $action ) { $this->countTestedActions++; - if ( $title->userCan( $action, $user ) ) { - $pageInfo['actions'][$action] = ''; - } + $pageInfo['actions'][$action] = $title->userCan( $action, $user ); } } @@ -532,7 +530,7 @@ class ApiQueryInfo extends ApiQueryBase { 'expiry' => $wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601 ) ); if ( $row->pr_cascade ) { - $a['cascade'] = ''; + $a['cascade'] = true; } $this->protections[$title->getNamespace()][$title->getDBkey()][] = $a; } @@ -870,6 +868,6 @@ class ApiQueryInfo extends ApiQueryBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Properties#info_.2F_in'; + return 'https://www.mediawiki.org/wiki/API:Info'; } }