From a6b600c8a1c37d12e0e4ae5e2f2c171a75c10fb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Sep 2017 03:54:23 +0200 Subject: [PATCH] Fix regression in unit tests --- htdocs/api/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 5d8763c7bfe..2730c6c0242 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -37,9 +37,9 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not lo if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) -$DOLAPIENTITY = $_SERVER['HTTP_DOLAPIENTITY']; -$entity=(! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : (! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : 1)); -if (is_numeric($entity)) define("DOLENTITY", $entity); +// Force entity if a value provided int HTTP header. Otherwise, will use the entity of user of token used. +if (! empty($_SERVER['HTTP_DOLAPIENTITY'])) define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']); + $res=0; if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php';