2
0
forked from Wavyzz/dolibarr

Better error management on import web site with PHP

This commit is contained in:
Laurent Destailleur
2024-05-06 15:16:08 +02:00
parent 55d2f3d9fc
commit 1a8eb720d1
2 changed files with 46 additions and 39 deletions

View File

@@ -328,7 +328,7 @@ function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler
$keyforsql = md5($sqlfile);
foreach ($arraysql as $i => $sql) {
if ($sql) {
// Test if th SQL is allowed SQL
// Test if the SQL is allowed SQL
if ($onlysqltoimportwebsite) {
$newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql); // Replace the \' char
@@ -388,6 +388,7 @@ function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler
break;
}
if (!$qualified) {
$error++;
//print 'Request '.($i + 1)." contains non allowed instructions.<br>\n";