Add option MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH

This commit is contained in:
Laurent Destailleur
2017-09-02 15:30:00 +02:00
parent 75e639db6c
commit e6f0e76988

View File

@@ -345,8 +345,20 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
}
elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname]))
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace);
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
{
// We made a search from quick search menu, do we still use default filter ?
if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH))
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace);
}
}
else
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace);
}
}
}
}