Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active December 24, 2023 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/820585e06dad19fde4cddd17d357a473 to your computer and use it in GitHub Desktop.
Save mcsee/820585e06dad19fde4cddd17d357a473 to your computer and use it in GitHub Desktop.
<?
private function addTerms(string $SQLselect) {
$selectSentence = $this->createSqlWhere();
// INJECTED CODE
$simplifiedTerms =
(new LikePatternSimplifier())->simplify($this->texts());
// INJECTED CODE
foreach ($simplifiedTerms as $text) {
$selectSentence->addWhere(
$this->tableAlias() .
" LIKE '%" .
$this->sanitize($text) .
"%'");
}
$SQLselect->addWhere($selectSentence->asSQLSentence());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment