Collapse duplicate $existingExpiry == 'infinity' case into else
authorReedy <reedy@wikimedia.org>
Sun, 15 Jun 2014 23:49:34 +0000 (00:49 +0100)
committerReedy <reedy@wikimedia.org>
Sun, 15 Jun 2014 23:49:34 +0000 (00:49 +0100)
Change-Id: I1cc612e9f646dd75f58cc6ae0ae073ebffa7d6d3

includes/ProtectionForm.php

index d34ee03..456e4e6 100644 (file)
@@ -117,15 +117,12 @@ class ProtectionForm {
                                // Expiry selected from list
                                $this->mExpiry[$action] = '';
                                $this->mExpirySelection[$action] = $requestExpirySelection;
-                       } elseif ( $existingExpiry == 'infinity' ) {
-                               // Existing expiry is infinite, use "infinite" in drop-down
-                               $this->mExpiry[$action] = '';
-                               $this->mExpirySelection[$action] = 'infinite';
                        } elseif ( $existingExpiry ) {
                                // Use existing expiry in its own list item
                                $this->mExpiry[$action] = '';
                                $this->mExpirySelection[$action] = $existingExpiry;
                        } else {
+                               // Catches 'infinity' - Existing expiry is infinite, use "infinite" in drop-down
                                // Final default: infinite
                                $this->mExpiry[$action] = '';
                                $this->mExpirySelection[$action] = 'infinite';