Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove characters *#_^ for like statement #1077

Closed
wants to merge 1 commit into from
Closed

Remove characters *#_^ for like statement #1077

wants to merge 1 commit into from

Conversation

lihombo
Copy link

@lihombo lihombo commented Mar 1, 2023

当like语句中的值包含*#_^四个字符串时,最终拼成的语句会丢掉%符号,导致查询结果不正确,原始逻辑如下(line: 942):
if (!preg_match('/((?<!\\\)\[.+(?<!\\\)\]|(?<!\\\)[\*\?\!\%#^_]|%.+|.+%)/', $item)) { $item = '%' . $item . '%'; }

@catfan catfan changed the title 移除like语句时对 *#_^ 四个字符的解析 Remove characters *#_^ for like statement Mar 2, 2023
@catfan
Copy link
Owner

catfan commented Mar 2, 2023

Those are wildcard characters! If you want to use this, add a slash.

https://www.w3schools.com/sql/sql_wildcards.asp

@catfan catfan closed this Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants