From 37437901601df5e4ba2d08ba883b3ea8be6c0747 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Dec 2020 15:49:25 +0100 Subject: [PATCH] Fix warning --- htdocs/webservices/server_order.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 7f2f2ebd43f..8c278768990 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -364,6 +364,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') $objectresp = array(); $errorcode = ''; $errorlabel = ''; $error = 0; + $socid = 0; $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -387,7 +388,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') if ($result > 0) { // Security for external user - if ($socid && (empty($order->socid) || $socid != $order->socid)) + if ($socid && $socid != $order->socid) { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request';