parent
feeb542e80
commit
e42353bc32
@ -111,7 +111,7 @@ if ($what == 'mysql')
|
||||
if (! empty($dolibarr_main_db_port)) $param.=" -P ".$dolibarr_main_db_port;
|
||||
if (! $_POST["use_transaction"]) $param.=" -l --single-transaction";
|
||||
if ($_POST["disable_fk"]) $param.=" -K";
|
||||
if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".GETPOST("sql_compat","special");
|
||||
if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".GETPOST("sql_compat","alpha");
|
||||
if ($_POST["drop_database"]) $param.=" --add-drop-database";
|
||||
if ($_POST["sql_structure"])
|
||||
{
|
||||
|
||||
@ -185,12 +185,7 @@ function GETPOST($paramname,$check='',$method=0)
|
||||
if ($check == 'int' && ! preg_match('/^[-\.,0-9]+$/i',trim($out))) $out='';
|
||||
// Check if alpha
|
||||
//if ($check == 'alpha' && ! preg_match('/^[ =:@#\/\\\(\)\-\._a-z0-9]+$/i',trim($out))) $out='';
|
||||
elseif ($check == 'alpha' && preg_match('/"/',trim($out))) $out=''; // Only " is dangerous because param in url can close the href= or src= and add javascript functions
|
||||
elseif ($check == 'special')
|
||||
{
|
||||
$out=trim($out);
|
||||
if (preg_match('/(\s)*|(%20)*/',$out)) $out='';
|
||||
}
|
||||
if ($check == 'alpha' && preg_match('/"/',trim($out))) $out=''; // Only " is dangerous because param in url can close the href= or src= and add javascript functions
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user