dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryInfo.php
diff --git
a/includes/api/ApiQueryInfo.php
b/includes/api/ApiQueryInfo.php
index
f5c49ad
..
6b8f98c
100644
(file)
--- a/
includes/api/ApiQueryInfo.php
+++ b/
includes/api/ApiQueryInfo.php
@@
-92,7
+92,7
@@
class ApiQueryInfo extends ApiQueryBase {
* The prototype for a token function is func($pageid, $title)
* it should return a token or false (permission denied)
* @deprecated since 1.24
* The prototype for a token function is func($pageid, $title)
* it should return a token or false (permission denied)
* @deprecated since 1.24
- * @return array
Array(tokenname => function)
+ * @return array
[ tokenname => function ]
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
@@
-427,7
+427,7
@@
class ApiQueryInfo extends ApiQueryBase {
foreach ( $this->params['token'] as $t ) {
$val = call_user_func( $tokenFunctions[$t], $pageid, $title );
if ( $val === false ) {
foreach ( $this->params['token'] as $t ) {
$val = call_user_func( $tokenFunctions[$t], $pageid, $title );
if ( $val === false ) {
- $this->
setWarning( "Action '$t' is not allowed for the current user"
);
+ $this->
addWarning( [ 'apiwarn-tokennotallowed', $t ]
);
} else {
$pageInfo[$t . 'token'] = $val;
}
} else {
$pageInfo[$t . 'token'] = $val;
}
@@
-535,7
+535,6
@@
class ApiQueryInfo extends ApiQueryBase {
* Get information about protections and put it in $protections
*/
private function getProtectionInfo() {
* Get information about protections and put it in $protections
*/
private function getProtectionInfo() {
- global $wgContLang;
$this->protections = [];
$db = $this->getDB();
$this->protections = [];
$db = $this->getDB();
@@
-554,7
+553,7
@@
class ApiQueryInfo extends ApiQueryBase {
$a = [
'type' => $row->pr_type,
'level' => $row->pr_level,
$a = [
'type' => $row->pr_type,
'level' => $row->pr_level,
- 'expiry' =>
$wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601
)
+ 'expiry' =>
ApiResult::formatExpiry( $row->pr_expiry
)
];
if ( $row->pr_cascade ) {
$a['cascade'] = true;
];
if ( $row->pr_cascade ) {
$a['cascade'] = true;
@@
-614,7
+613,7
@@
class ApiQueryInfo extends ApiQueryBase {
$this->protections[$row->pt_namespace][$row->pt_title][] = [
'type' => 'create',
'level' => $row->pt_create_perm,
$this->protections[$row->pt_namespace][$row->pt_title][] = [
'type' => 'create',
'level' => $row->pt_create_perm,
- 'expiry' =>
$wgContLang->formatExpiry( $row->pt_expiry, TS_ISO_8601
)
+ 'expiry' =>
ApiResult::formatExpiry( $row->pt_expiry
)
];
}
}
];
}
}
@@
-652,7
+651,7
@@
class ApiQueryInfo extends ApiQueryBase {
$this->protections[$row->tl_namespace][$row->tl_title][] = [
'type' => $row->pr_type,
'level' => $row->pr_level,
$this->protections[$row->tl_namespace][$row->tl_title][] = [
'type' => $row->pr_type,
'level' => $row->pr_level,
- 'expiry' =>
$wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601
),
+ 'expiry' =>
ApiResult::formatExpiry( $row->pr_expiry
),
'source' => $source->getPrefixedText()
];
}
'source' => $source->getPrefixedText()
];
}
@@
-675,7
+674,7
@@
class ApiQueryInfo extends ApiQueryBase {
$this->protections[NS_FILE][$row->il_to][] = [
'type' => $row->pr_type,
'level' => $row->pr_level,
$this->protections[NS_FILE][$row->il_to][] = [
'type' => $row->pr_type,
'level' => $row->pr_level,
- 'expiry' =>
$wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601
),
+ 'expiry' =>
ApiResult::formatExpiry( $row->pr_expiry
),
'source' => $source->getPrefixedText()
];
}
'source' => $source->getPrefixedText()
];
}
@@
-767,7
+766,7
@@
class ApiQueryInfo extends ApiQueryBase {
if ( $this->fld_watched ) {
foreach ( $timestamps as $namespaceId => $dbKeys ) {
$this->watched[$namespaceId] = array_map(
if ( $this->fld_watched ) {
foreach ( $timestamps as $namespaceId => $dbKeys ) {
$this->watched[$namespaceId] = array_map(
- function( $x ) {
+ function
( $x ) {
return $x !== false;
},
$dbKeys
return $x !== false;
},
$dbKeys
@@
-848,7
+847,7
@@
class ApiQueryInfo extends ApiQueryBase {
$timestamps[$row->page_namespace][$row->page_title] = $revTimestamp - $age;
}
$titlesWithThresholds = array_map(
$timestamps[$row->page_namespace][$row->page_title] = $revTimestamp - $age;
}
$titlesWithThresholds = array_map(
- function( LinkTarget $target ) use ( $timestamps ) {
+ function
( LinkTarget $target ) use ( $timestamps ) {
return [
$target, $timestamps[$target->getNamespace()][$target->getDBkey()]
];
return [
$target, $timestamps[$target->getNamespace()][$target->getDBkey()]
];
@@
-861,7
+860,7
@@
class ApiQueryInfo extends ApiQueryBase {
$titlesWithThresholds = array_merge(
$titlesWithThresholds,
array_map(
$titlesWithThresholds = array_merge(
$titlesWithThresholds,
array_map(
- function( LinkTarget $target ) {
+ function
( LinkTarget $target ) {
return [ $target, null ];
},
$this->missing
return [ $target, null ];
},
$this->missing
@@
-947,6
+946,6
@@
class ApiQueryInfo extends ApiQueryBase {
}
public function getHelpUrls() {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Info';
+ return 'https://www.mediawiki.org/wiki/
Special:MyLanguage/
API:Info';
}
}
}
}