From 538f189285944deeadea711a388615e1d4a760b8 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Wed, 22 Jan 2020 00:33:29 +0900 Subject: [PATCH] Update database.php --- system/database.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/database.php b/system/database.php index 3fecb58..d561594 100644 --- a/system/database.php +++ b/system/database.php @@ -292,6 +292,9 @@ if(!check_function_exists("get_bind_to_sql_insert")) { // get not duplicatable fieldnames $setkeys = get_array(get_value_in_array("setkeys", $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 $num_duplicates = 0; @@ -316,6 +319,9 @@ if(!check_function_exists("get_bind_to_sql_insert")) { foreach($_rows as $_row) { $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