From 1b1bdbb150c88d9e00a8982085e325e6624e0575 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 3 May 2019 19:44:07 +0900 Subject: [PATCH] Update database.php --- system/database.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database.php b/system/database.php index 653f37d..242d9e6 100644 --- a/system/database.php +++ b/system/database.php @@ -430,7 +430,8 @@ if(!check_function_exists("get_bind_to_sql_select")) { } elseif(check_array_length($opts, 2) == 0 && is_array($opts[1])) { if($opts[1][0] == "like") { if(is_array($opts[1][2])) { - $s3 .= sprintf(" %s (%s regexp '%s')", $opts[0], $s1a[$opts[1][1]], implode("|", $opts[1][2])); + // regexp: ^(^a|^b) == a and b + $s3 .= sprintf(" %s (%s regexp '^(^%s)')", $opts[0], $s1a[$opts[1][1]], implode("|^", $opts[1][2])); } else { $s3 .= sprintf(" %s (%s like %s)", $opts[0], $s1a[$opts[1][1]], "'%{$opts[1][2]}%'"); }