Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 15.35.3 #1103

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading