From 2f89d526eb49b16d03138414ca4ef5789259d273 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Oct 2020 16:43:56 +0200 Subject: [PATCH] Avoid to get a random result. --- htdocs/stripe/class/stripe.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 2ac8193a71e..e50f48aad69 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -90,11 +90,13 @@ class Stripe extends CommonObject global $conf; $sql = "SELECT tokenstring"; - $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token WHERE"; + $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; + $sql .= " WHERE service = '".$this->db->escape($mode)."'"; if (empty($fk_soc)) $sql .= " entity = ".$conf->entity. " AND"; - $sql .= " service = '".$mode."'"; if ($fk_soc > 0) { $sql .= " AND fk_soc = ".$fk_soc; + } else { + $sql .= " AND fk_soc IS NULL"; } $sql .= " AND fk_user IS NULL AND fk_adherent IS NULL";