FIX Install run_sql function accept -- into sql content.

This commit is contained in:
Laurent Destailleur 2017-08-26 19:19:23 +02:00
parent 77af3b96d3
commit d9a85e6d3b

View File

@ -189,7 +189,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// Add line buf to buffer if not a comment // Add line buf to buffer if not a comment
if (! preg_match('/^--/',$buf)) if (! preg_match('/^--/',$buf))
{ {
$buf=preg_replace('/--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer $buf=preg_replace('/[,;]\s*--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer
$buffer .= trim($buf); $buffer .= trim($buf);
} }