Skip to content

Commit 90d3328

Browse files
Cameron HallLuke McMahon
Cameron Hall
authored and
Luke McMahon
committed
Fixed state validation
1 parent a9bc4bd commit 90d3328

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

modules/registrars/synergywholesaledomains/synergywholesaledomains.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ function synergywholesaledomains_SaveContactDetails(array $params)
10311031
'technical' => 'Tech',
10321032
'billing' => 'Billing',
10331033
];
1034-
1034+
10351035
foreach ($contactTypes as $contactType => $whmcs_contact) {
10361036
if (!isset($params['contactdetails'][$whmcs_contact])) {
10371037
continue;
@@ -1046,8 +1046,6 @@ function synergywholesaledomains_SaveContactDetails(array $params)
10461046
$params['contactdetails'][$whmcs_contact]['Address 3'],
10471047
];
10481048

1049-
$request["{$contactType}_address"] = array_filter($request["{$contactType}_address"]);
1050-
10511049
$request["{$contactType}_email"] = $params['contactdetails'][$whmcs_contact]['Email'];
10521050
$request["{$contactType}_suburb"] = $params['contactdetails'][$whmcs_contact]['City'];
10531051
$request["{$contactType}_postcode"] = $params['contactdetails'][$whmcs_contact]['Postcode'];
@@ -1061,10 +1059,10 @@ function synergywholesaledomains_SaveContactDetails(array $params)
10611059

10621060
$request["{$contactType}_country"] = $params['contactdetails'][$whmcs_contact]['Country'];
10631061
// See if country is AU
1064-
if ('AU' == $country) {
1062+
if ('AU' == $request["{$contactType}_country"]) {
10651063
// It is, so check to see if a valid AU State has been specified
10661064
$state = synergywholesaledomains_validateAUState($params['contactdetails'][$whmcs_contact]['State']);
1067-
if (!$state) {
1065+
if (!empty($params['contactdetails'][$whmcs_contact]['State']) && !$state) {
10681066
return [
10691067
'error' => 'A Valid Australian State Name Must Be Supplied, EG. NSW, VIC',
10701068
];

0 commit comments

Comments
 (0)