* Get information about protections and put it in $protections
*/
private function getProtectionInfo() {
- global $wgContLang;
$this->protections = [];
$db = $this->getDB();
$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;
$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 )
];
}
}
$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()
];
}
$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()
];
}
if ( $this->fld_watched ) {
foreach ( $timestamps as $namespaceId => $dbKeys ) {
$this->watched[$namespaceId] = array_map(
- function( $x ) {
+ function ( $x ) {
return $x !== false;
},
$dbKeys
$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()]
];
$titlesWithThresholds = array_merge(
$titlesWithThresholds,
array_map(
- function( LinkTarget $target ) {
+ function ( LinkTarget $target ) {
return [ $target, null ];
},
$this->missing
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Info';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Info';
}
}