Skip to content

fix: table name is double prefixed when LIKE clause - #5778

Merged
samsonasik merged 3 commits into
codeigniter4:developfrom
kenjis:fix-like-dbprefix
Mar 8, 2022
Merged

fix: table name is double prefixed when LIKE clause#5778
samsonasik merged 3 commits into
codeigniter4:developfrom
kenjis:fix-like-dbprefix

Conversation

@kenjis

@kenjis kenjis commented Mar 6, 2022

Copy link
Copy Markdown
Member

Description
Fixes #5775

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer labels Mar 6, 2022
@iRedds

iRedds commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator

Double escaping when using the LIKE clause.

$likeStatement = $this->_like_statement($prefix, $this->db->protectIdentifiers($k, false, $escape), $not, $bind, $insensitiveSearch);

$condition = $matches[1] . $this->db->protectIdentifiers(trim($matches[2]))

Does it make sense?

@kenjis
kenjis force-pushed the fix-like-dbprefix branch from 2299fa9 to 3480cca Compare March 6, 2022 23:03
@kenjis

kenjis commented Mar 6, 2022

Copy link
Copy Markdown
Member Author

It is from #5170.
We might have made a mistake.
We need to reconsider.

@kenjis
kenjis force-pushed the fix-like-dbprefix branch from 3480cca to 7509003 Compare March 6, 2022 23:27
@kenjis

kenjis commented Mar 7, 2022

Copy link
Copy Markdown
Member Author

Removed double escape.

@samsonasik
samsonasik merged commit 7e763f5 into codeigniter4:develop Mar 8, 2022
@samsonasik

Copy link
Copy Markdown
Member

Thank you @kenjis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: table has double prefix when LIKE clause

3 participants