Bug #87620
closedContentObjectRenderer->searchWhere will do exception with too short word.
100%
Description
If a $searchWords is one word with length less then three digits result query will be broken.
#line: 7023
foreach ($searchWords as $searchWord) {
$searchWord = trim($searchWord);
if (strlen($searchWord) < 3) {//TODO code will do that
continue;
}
$searchWordConstraint = $queryBuilder->expr()->orX();
$searchWord = $queryBuilder->escapeLikeWildcards($searchWord);
foreach ($searchFields as $field) {
$searchWordConstraint->add(
$queryBuilder->expr()->like($prefixTableName . $field, $queryBuilder->quote('%' . $searchWord . '%'))
);
}
if ($searchWordConstraint->count()) {
$where->add($searchWordConstraint);//TODO And this code will never be called
}
}
return ' AND ' . (string)$where;
In the result we will get ' AND ' in any query it will call fatal error.
Updated by Georg Ringer almost 6 years ago
- Subject changed from ContentObjectRenderer->searchWhere will do exception with to short word. to ContentObjectRenderer->searchWhere will do exception with too short word.
Updated by Gerrit Code Review about 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61892
Updated by Gerrit Code Review about 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61892
Updated by Gerrit Code Review about 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61892
Updated by Gerrit Code Review about 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61892
Updated by Gerrit Code Review about 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61930
Updated by Christian Eßl about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4edd28c4fb15ceceaf605e0c9f8f51b2f2c0f4b3.