Fixed issue in paid subscription forms
authorMarcel Werk <burntime@woltlab.com>
Sat, 5 Dec 2015 13:09:16 +0000 (14:09 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sat, 5 Dec 2015 13:09:16 +0000 (14:09 +0100)
wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php

index 7357d726c29173ed9b508e54c171fcd32d3cae83..afed0ac75a0985ee2807462bdf50972d89a32a92 100644 (file)
@@ -186,8 +186,10 @@ class PaidSubscriptionAddForm extends AbstractForm {
                if (isset($_POST['cost'])) $this->cost = floatval($_POST['cost']);
                if (isset($_POST['currency'])) $this->currency = $_POST['currency'];
                if (!empty($_POST['subscriptionLengthPermanent'])) $this->subscriptionLengthPermanent = 1;
-               if (isset($_POST['subscriptionLength'])) $this->subscriptionLength = intval($_POST['subscriptionLength']);
-               if (isset($_POST['subscriptionLengthUnit'])) $this->subscriptionLengthUnit = $_POST['subscriptionLengthUnit'];
+               if (!$this->subscriptionLengthPermanent) {
+                       if (isset($_POST['subscriptionLength'])) $this->subscriptionLength = intval($_POST['subscriptionLength']);
+                       if (isset($_POST['subscriptionLengthUnit'])) $this->subscriptionLengthUnit = $_POST['subscriptionLengthUnit'];
+               }
                if (!empty($_POST['isRecurring'])) $this->isRecurring = 1;
                if (isset($_POST['groupIDs']) && is_array($_POST['groupIDs'])) $this->groupIDs = ArrayUtil::toIntegerArray($_POST['groupIDs']);
                if (isset($_POST['excludedSubscriptionIDs']) && is_array($_POST['excludedSubscriptionIDs'])) $this->excludedSubscriptionIDs = ArrayUtil::toIntegerArray($_POST['excludedSubscriptionIDs']);
index 02e45401aa0b8999259c6064399a73ac44330cc0..ea0cf1d746a1ad01386c9c5439ff61a6c98b0290 100644 (file)
@@ -93,8 +93,10 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm {
                if (isset($_POST['cost'])) $this->cost = floatval($_POST['cost']);
                if (isset($_POST['currency'])) $this->currency = $_POST['currency'];
                if (!empty($_POST['subscriptionLengthPermanent'])) $this->subscriptionLengthPermanent = 1;
-               if (isset($_POST['subscriptionLength'])) $this->subscriptionLength = intval($_POST['subscriptionLength']);
-               if (isset($_POST['subscriptionLengthUnit'])) $this->subscriptionLengthUnit = $_POST['subscriptionLengthUnit'];
+               if (!$this->subscriptionLengthPermanent) {
+                       if (isset($_POST['subscriptionLength'])) $this->subscriptionLength = intval($_POST['subscriptionLength']);
+                       if (isset($_POST['subscriptionLengthUnit'])) $this->subscriptionLengthUnit = $_POST['subscriptionLengthUnit'];
+               }       
                if (!empty($_POST['isRecurring'])) $this->isRecurring = 1;
                if (isset($_POST['groupIDs']) && is_array($_POST['groupIDs'])) $this->groupIDs = ArrayUtil::toIntegerArray($_POST['groupIDs']);
        }