From 63df7ba0d4bb2392deb3f527900f1a2d6b5639dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Jan 2022 21:10:33 +0100 Subject: [PATCH] Clean code --- htdocs/install/repair.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index d7ebdc74a46..8e4cc851d28 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1082,7 +1082,7 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) { $constantname = $obj->name; // Name of constant for hook or js or css declaration print ''; - print $constantname; + print dol_escape_htmltag($constantname); $db->begin(); @@ -1106,7 +1106,8 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) { if ($key == 'css') { $value = $obj->value; $valuearray = json_decode($value); - if ($value && count($valuearray) == 0) { + if ($value && (!is_array($valuearray) || count($valuearray) == 0)) { + $valuearray = array(); $valuearray[0] = $value; // If value was not a json array but a string } $reloffile = preg_replace('/^\//', '', $valuearray[0]); @@ -1117,9 +1118,10 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) { try { $result = dol_buildpath($reloffile, 0, 2); } catch (Exception $e) { - // No catch yet - $result = 'found'; // If error, we force lke if we found to avoid any deletion + $result = 'found'; // If error, we force like if we found to avoid any deletion } + } else { + $result = 'found'; // } if (!$result) {