Update database.php

This commit is contained in:
Namhyeon Go 2019-05-03 19:44:07 +09:00 committed by GitHub
parent 26e88b4858
commit 1b1bdbb150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]}%'");
}