From 6607dda4a70fcbd8efa20d3fcb9e9a2300e00eed Mon Sep 17 00:00:00 2001 From: Hystepik Date: Thu, 15 Jun 2023 11:29:14 +0200 Subject: [PATCH] Fix : bug with object id -1 in security check --- htdocs/core/lib/security.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 52e7a975338..2d5b06fe999 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -353,6 +353,9 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', } else { $objectid = $object; // $objectid can be X or 'X,Y,Z' } + if ($objectid == "-1") { + $objectid = 0; + } if ($objectid) { $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input }