From: Kunal Mehta Date: Fri, 20 Dec 2013 09:06:51 +0000 (-0800) Subject: API: Allow 'infinity' as a valid protection expiry X-Git-Tag: 1.31.0-rc.0~15374 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=e179b4f11b8eb194481efb72432f7bc78421aaf2;p=lhc%2Fweb%2Fwiklou.git API: Allow 'infinity' as a valid protection expiry Change-Id: If9eb1f3e835579f5c8b8be22297a1eb26beda4e7 --- diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index ffbf01b1bf..b9f97e3536 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -77,7 +77,7 @@ class ApiProtect extends ApiBase { $this->dieUsageMsg( array( 'protect-invalidlevel', $p[1] ) ); } - if ( in_array( $expiry[$i], array( 'infinite', 'indefinite', 'never' ) ) ) { + if ( in_array( $expiry[$i], array( 'infinite', 'indefinite', 'infinity', 'never' ) ) ) { $expiryarray[$p[0]] = $db->getInfinity(); } else { $exp = strtotime( $expiry[$i] ); @@ -187,7 +187,7 @@ class ApiProtect extends ApiBase { 'expiry' => array( 'Expiry timestamps. If only one timestamp is ' . 'set, it\'ll be used for all protections.', - 'Use \'infinite\', \'indefinite\' or \'never\', for a never-expiring protection.' + 'Use \'infinite\', \'indefinite\', \'infinity\' or \'never\', for a never-expiring protection.' ), 'reason' => 'Reason for (un)protecting', 'cascade' => array(