summaryrefslogtreecommitdiff
path: root/includes/api/ApiProtect.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/api/ApiProtect.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/api/ApiProtect.php')
-rw-r--r--includes/api/ApiProtect.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php
index ad028375..c07aaca4 100644
--- a/includes/api/ApiProtect.php
+++ b/includes/api/ApiProtect.php
@@ -29,6 +29,8 @@
*/
class ApiProtect extends ApiBase {
public function execute() {
+ global $wgContLang;
+
$params = $this->extractRequestParams();
$pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
@@ -78,7 +80,7 @@ class ApiProtect extends ApiBase {
}
if ( wfIsInfinity( $expiry[$i] ) ) {
- $expiryarray[$p[0]] = $db->getInfinity();
+ $expiryarray[$p[0]] = 'infinity';
} else {
$exp = strtotime( $expiry[$i] );
if ( $exp < 0 || !$exp ) {
@@ -93,10 +95,7 @@ class ApiProtect extends ApiBase {
}
$resultProtections[] = array(
$p[0] => $protections[$p[0]],
- 'expiry' => ( $expiryarray[$p[0]] == $db->getInfinity()
- ? 'infinite'
- : wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] )
- )
+ 'expiry' => $wgContLang->formatExpiry( $expiryarray[$p[0]], TS_ISO_8601, 'infinite' ),
);
}