From 51ed2221250645bfc2758e859b338a0fb6b509ca Mon Sep 17 00:00:00 2001 From: Anne Limoges Date: Sun, 6 Jan 2013 19:05:41 +0100 Subject: [PATCH] Bugfix on paypal payments for users without adresses. --- modules/payment/money/paypal.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/payment/money/paypal.inc.php b/modules/payment/money/paypal.inc.php index 98d78c6..f1bb052 100644 --- a/modules/payment/money/paypal.inc.php +++ b/modules/payment/money/paypal.inc.php @@ -81,13 +81,17 @@ class PayPal GROUP BY pa.pid, pa.jobid, pa.groupid, pa.id, pa.type LIMIT 1", $user->profile()->id()); - $this->infos['client'] = array_map('replace_accent', array_merge($info_client, $res->fetchOneAssoc())); - list($this->infos['client']['address1'], $this->infos['client']['address2']) = - explode("\n", Geocoder::getFirstLines($this->infos['client']['text'], + if(is_array($res)) { + $this->infos['client'] = array_map('replace_accent', array_merge($info_client, $res->fetchOneAssoc())); + list($this->infos['client']['address1'], $this->infos['client']['address2']) = + explode("\n", Geocoder::getFirstLines($this->infos['client']['text'], $this->infos['client']['zip'], 2)); - unset($this->infos['client']['text']); + unset($this->infos['client']['text']); + } else { + $this->infos['client'] = array_map('replace_accent', $info_client); + } } else { - $this->infos['client'] = replace_accent($info_client); + $this->infos['client'] = array_map('replace_accent', $info_client); } // We build the transaction's reference -- 2.1.4