Update database.php

This commit is contained in:
Namhyeon Go 2020-01-22 00:33:29 +09:00 committed by GitHub
parent f1161d2744
commit 538f189285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,6 +293,9 @@ if(!check_function_exists("get_bind_to_sql_insert")) {
$setkeys = get_array(get_value_in_array("setkeys", $options, false)); $setkeys = get_array(get_value_in_array("setkeys", $options, false));
$setignores = get_array(get_value_in_array("setignores", $options, false)); $setignores = get_array(get_value_in_array("setignores", $options, false));
// safemode_off (default: false)
$safemode_off = array_key_equals("safemode_off", $options, true);
// set variables // set variables
$num_duplicates = 0; $num_duplicates = 0;
$num_ignores = 0; $num_ignores = 0;
@ -316,6 +319,9 @@ if(!check_function_exists("get_bind_to_sql_insert")) {
foreach($_rows as $_row) { foreach($_rows as $_row) {
$num_duplicates += intval($_row['value']); $num_duplicates += intval($_row['value']);
} }
} elseif($safemode_off !== true) {
write_common_log("Blocked this SQL because it is maybe accidentally query. If you want continue, set safemode_off option to true", "system/database");
return false;
} }
// check ignores // check ignores