forked from Wavyzz/dolibarr
FIX avoid sql error when a comment is after without comma (#33758)
* FIX avoid sql error when a comment is after without comma * FIX syntax error * Update admin.lib.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -242,7 +242,7 @@ function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler
|
||||
// Add line buf to buffer if not a comment
|
||||
if ($nocommentremoval || !preg_match('/^\s*--/', $buf)) {
|
||||
if (empty($nocommentremoval)) {
|
||||
$buf = preg_replace('/([,;ERLT\)])\s*--.*$/i', '\1', $buf); //remove comment from a line that not start with -- before add it to the buffer
|
||||
$buf = preg_replace('/([,;ERLT0\)])\s+--.*$/i', '\1', $buf); //remove comment on lines that does not start with --, before adding it to the buffer
|
||||
}
|
||||
if ($buffer) {
|
||||
$buffer .= ' ';
|
||||
|
||||
Reference in New Issue
Block a user