Merge branch '145-plain-text-mail-cannot-be-send-by-email_problems_mr' into 'develop'

fixed error in function check mr

See merge request !921
This commit is contained in:
vgilc 2017-10-16 10:26:31 +02:00
commit 4c3e200946
1 changed files with 66 additions and 62 deletions

View File

@ -1329,12 +1329,14 @@ function db_run_sql_file ($location) {
foreach ($lines as $line) { foreach ($lines as $line) {
$line = trim($line); $line = trim($line);
if ($line && !preg_match('/^--/', $line) && !preg_match('/^\/\*/', $line)) { if ($line && !preg_match('/^--/', $line) && !preg_match('/^\/\*/', $line)) {
$line = preg_replace('/;$/',"__;__", $line);
$commands .= $line; $commands .= $line;
} }
} }
// Convert to array // Convert to array
$commands = explode(";", $commands); $commands = explode("__;__", $commands);
if ($config['mysqli']) { if ($config['mysqli']) {
$mysqli = new mysqli($config["dbhost"], $config["dbuser"], $config["dbpass"], $config["dbname"], $config["dbport"]); $mysqli = new mysqli($config["dbhost"], $config["dbuser"], $config["dbpass"], $config["dbname"], $config["dbport"]);
@ -1350,6 +1352,8 @@ function db_run_sql_file ($location) {
foreach ($commands as $command) { foreach ($commands as $command) {
if (trim($command)) { if (trim($command)) {
$command .= ";";
if ($config['mysqli']) { if ($config['mysqli']) {
$result = $mysqli->query($command); $result = $mysqli->query($command);
} }