diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/api/ApiProtect.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/api/ApiProtect.php')
-rw-r--r-- | includes/api/ApiProtect.php | 9 |
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' ), ); } |