Clean code
This commit is contained in:
parent
2b19bcef54
commit
63df7ba0d4
@ -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
|
$constantname = $obj->name; // Name of constant for hook or js or css declaration
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $constantname;
|
print dol_escape_htmltag($constantname);
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -1106,7 +1106,8 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) {
|
|||||||
if ($key == 'css') {
|
if ($key == 'css') {
|
||||||
$value = $obj->value;
|
$value = $obj->value;
|
||||||
$valuearray = json_decode($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
|
$valuearray[0] = $value; // If value was not a json array but a string
|
||||||
}
|
}
|
||||||
$reloffile = preg_replace('/^\//', '', $valuearray[0]);
|
$reloffile = preg_replace('/^\//', '', $valuearray[0]);
|
||||||
@ -1117,9 +1118,10 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) {
|
|||||||
try {
|
try {
|
||||||
$result = dol_buildpath($reloffile, 0, 2);
|
$result = dol_buildpath($reloffile, 0, 2);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// No catch yet
|
$result = 'found'; // If error, we force like if we found to avoid any deletion
|
||||||
$result = 'found'; // If error, we force lke if we found to avoid any deletion
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$result = 'found'; //
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user