mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
ΩUAL can defined a json format in default search filters
This commit is contained in:
@@ -986,10 +986,16 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
||||
$forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
|
||||
}
|
||||
} else {
|
||||
// Check if the value is a json format for use with multiselect field, eg ["1","2"]
|
||||
if (preg_match('/^\[.*\]$/', $user->default_values[$relativepathstring]['filters'][$defkey][$paramname])) {
|
||||
$out = json_decode($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], true);
|
||||
$check = 'array'; // force to check an array
|
||||
} else {
|
||||
$forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user