API: Allow 'infinity' as a valid protection expiry
authorKunal Mehta <legoktm@gmail.com>
Fri, 20 Dec 2013 09:06:51 +0000 (01:06 -0800)
committerReedy <reedy@wikimedia.org>
Sun, 15 Jun 2014 23:46:37 +0000 (23:46 +0000)
Change-Id: If9eb1f3e835579f5c8b8be22297a1eb26beda4e7

includes/api/ApiProtect.php

index ffbf01b..b9f97e3 100644 (file)
@@ -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(