Skip to content

Commit

Permalink
fix(form): doubling starcauses SQL error
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 20, 2020
1 parent faf8a9c commit 5f26fcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public static function prepareBooleanKeywords($keywords) {
foreach ($matches as &$keyword) {
if (strpos($keyword, '"') !== 0) {
// keyword does not begins with a double quote (assume it does not ends with this char)
$keyword = rtrim($keyword, '*');
$keyword .= '*';
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/suite-unit/PluginFormcreatorCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public function providerPrepareBooleanKeywords() {
'input' => 'foo bar ',
'expected' => 'foo* bar*',
],
[
'input' => 'foo***** bar* ',
'expected' => 'foo* bar*',
],
];
}

Expand Down

0 comments on commit 5f26fcc

Please sign in to comment.