Skip to content

Commit

Permalink
Merge branch 'release-15.35.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 16, 2024
2 parents 626038c + 49282ba commit 50b0b1b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/kernel/persistence/starsql/search/Command/RegexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ public function escapeString($values): string
trim($values, '%'),
[
'.' => '\\.',
'+' => '\\+',
'?' => '\\?',
'[' => '\\[',
']' => '\\]',
'(' => '\\(',
')' => '\\)',
'{' => '\\{',
'}' => '\\}',
'^' => '\\^',
'$' => '\\$',
'|' => '\\|',
'\\_' => '_',
'\\%' => '%',
'*' => '.*',
Expand Down
48 changes: 48 additions & 0 deletions test/integration/model/persistence/starsql/ClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,54 @@ public function dataProviderSearchInstancesWithRegularExpressions(): iterable
'incorrectLabel' => 'test case instance with special ymbols',
'searchCriterion' => 'w\_th \%pecial \%ymbols',
];

yield 'regexp plus symbols' => [
'correctLabel' => 'application/qti+xml',
'incorrectLabel' => 'application/qtiiiiixml',
'searchCriterion' => 'application/qti+xml',
];

yield 'regexp question mark symbols' => [
'correctLabel' => 'test case instance with question?',
'incorrectLabel' => 'test case instance with question!',
'searchCriterion' => '*question?*',
];

yield 'regexp square brackets symbols' => [
'correctLabel' => 'test case instance with [abc]',
'incorrectLabel' => 'test case instance with c',
'searchCriterion' => '*with [abc]*',
];

yield 'regexp round brackets symbols' => [
'correctLabel' => 'test case instance with (brackets)',
'incorrectLabel' => 'test case instance with brackets',
'searchCriterion' => '*with (brackets)*',
];

yield 'regexp curly brackets symbols' => [
'correctLabel' => 'test case instance with{1,2}',
'incorrectLabel' => 'test case instance withh',
'searchCriterion' => '*with{1,2}*',
];

yield 'regexp dollar symbols' => [
'correctLabel' => 'test case instance with$',
'incorrectLabel' => 'test case instance with',
'searchCriterion' => '*with$',
];

yield 'regexp caret symbols' => [
'correctLabel' => '^test case instance with',
'incorrectLabel' => 'test case instance with',
'searchCriterion' => '^test*',
];

yield 'regexp pipe symbols' => [
'correctLabel' => 'test case instance with|pipe',
'incorrectLabel' => 'test case instance with',
'searchCriterion' => '*with|pipe*',
];
}

/**
Expand Down

0 comments on commit 50b0b1b

Please sign in to comment.