From 4b4dc8fe0d8c840108c83c945b37abfeb5e5e99f Mon Sep 17 00:00:00 2001 From: Jean-Pierre Morfin Date: Sat, 10 Dec 2016 11:49:16 +0100 Subject: [PATCH] FIX Calling soc.php with an unknown socid display a message Fix #4632 Calling soc.php with an unknown socid display a simple error message --- htdocs/societe/soc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cc0465a0b68..dcd7eeefcd8 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -72,6 +72,12 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('thirdpartycard','globalcard')); +if ($action == 'view' && $object->fetch($socid)<=0) +{ + $langs->load("errors"); + print($langs->trans('ErrorRecordNotFound')); + exit; +} // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($socid);