From b2d6af6a27a18dad7e9926a96fa69ff09812cc18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 3 Jan 2011 13:22:12 +0100 Subject: [PATCH] Fixes PHP errors in PayPal payments (Closes #1318). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 3 +++ modules/payment/money/paypal.inc.php | 29 +++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index b80bd1a..58f7518 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ Bug/Wish: * Core: - #1355: Mode with propagation of the skinning mode -FRU + * Payments: + - #1318: Fixes PHP errors in PayPal payments -JAC + * Profile: - #1340: Allows secretaries and admin to fully edit profiles' name -JAC - #1354: Do not notify death to a deceased user -JAC diff --git a/modules/payment/money/paypal.inc.php b/modules/payment/money/paypal.inc.php index e7ae70d..f0985b5 100644 --- a/modules/payment/money/paypal.inc.php +++ b/modules/payment/money/paypal.inc.php @@ -44,29 +44,26 @@ class PayPal $this->urlform = 'https://' . $globals->money->paypal_site . '/cgi-bin/webscr'; $user = S::user(); - $name = $user->lastName(); $roboturl = str_replace("https://","http://",$globals->baseurl) . '/' . $platal->ns . "payment/paypal_return/" . S::v('uid') . "?comment=" . urlencode(Env::v('comment')); - $this->infos = array(); - - $this->infos['commercant'] = array( - 'business' => $globals->money->paypal_compte, - 'rm' => 2, - 'return' => $roboturl, - 'cn' => 'Commentaires', - 'no_shipping' => 1, - 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ? - 'Revenir sur polytechnique.org.' : - 'Revenir sur polytechnique.net.' + $this->infos = array( + 'commercant' => array( + 'business' => $globals->money->paypal_compte, + 'rm' => 2, + 'return' => $roboturl, + 'cn' => 'Commentaires', + 'no_shipping' => 1, + 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ? 'Revenir sur polytechnique.org.' : 'Revenir sur polytechnique.net.' + ) ); $info_client = array( - 'first_name' => S::v('prenom'), - 'last_name' => $name, - 'email' => S::user()->bestEmail() + 'first_name' => $user->firstName(), + 'last_name' => $user->lastName(), + 'email' => $user->bestEmail() ); $res = XDB::query("SELECT pa.text, gl.name AS city, pa.postalCode AS zip, pa.countryId AS country, @@ -79,7 +76,7 @@ class PayPal LEFT JOIN geoloc_localities AS gl ON (gl.id = pa.localityId) WHERE pa.pid = {?} AND FIND_IN_SET('current', pa.flags) LIMIT 1", - S::i('pid')); + $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'], -- 2.1.4