mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Fix search starting with special characters (#7189)
This commit is contained in:
parent
02beaa3e6b
commit
f426f94a3b
@ -23,6 +23,7 @@ HumHub Changelog
|
||||
- Fix #7180: Fix active form on user edit form for correct working of widget inputs
|
||||
- Fix #7181: Fix duplicated label of checkbox profile field
|
||||
- Fix #7182: Fix initialization of several select2 inputs on the same page
|
||||
- Fix #7152: Fix search starting with special characters
|
||||
|
||||
1.16.1 (July 1, 2024)
|
||||
---------------------
|
||||
|
@ -315,9 +315,11 @@ humhub.module('ui.additions', function (module, require, $) {
|
||||
}
|
||||
|
||||
if (typeof words === 'string' && words !== '') {
|
||||
words = words.match(/[^\s]+\/[^\s]+|"[^"]+"|[\p{L}\d]+(?:['’`]\p{L}+)?/gu)
|
||||
.map(item => item.replace(/"/g, ''));
|
||||
words = [...new Set(words)].sort((a, b) => b.length - a.length);
|
||||
words = words.match(/[^\s]+\/[^\s]+|"[^"]+"|[\p{L}\d]+(?:['’`]\p{L}+)?/gu);
|
||||
if (Array.isArray(words)) {
|
||||
words = words.map(item => item.replace(/"/g, ''));
|
||||
words = [...new Set(words)].sort((a, b) => b.length - a.length);
|
||||
}
|
||||
}
|
||||
if (!Array.isArray(words)) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user