mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for bad country codes in client request
This commit is contained in:
parent
dbb60c029e
commit
aff6eb2701
@ -116,7 +116,7 @@ class StoreClientRequest extends Request
|
||||
|
||||
$input['settings'] = $settings;
|
||||
|
||||
if (isset($input['country_code'])) {
|
||||
if (isset($input['country_code']) && strlen($input['country_code']) == 3) {
|
||||
$input['country_id'] = $this->getCountryCode($input['country_code']);
|
||||
}
|
||||
|
||||
@ -144,7 +144,10 @@ class StoreClientRequest extends Request
|
||||
return $item->iso_3166_2 == $country_code || $item->iso_3166_3 == $country_code;
|
||||
})->first();
|
||||
|
||||
return (string) $country->id;
|
||||
if($country)
|
||||
return (string) $country->id;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private function getCurrencyCode($code)
|
||||
|
Loading…
x
Reference in New Issue
Block a user