mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-14 05:14:46 +00:00
Compare commits
3 commits
510bb9e551
...
0664431d0d
Author | SHA1 | Date | |
---|---|---|---|
|
0664431d0d | ||
|
012256b297 | ||
|
c0d7171dbf |
1 changed files with 5 additions and 1 deletions
|
@ -325,7 +325,11 @@ export default {
|
|||
let searchTextMatch = true;
|
||||
if (this.searchText !== "") {
|
||||
try {
|
||||
const regex = new RegExp(this.searchText, "i"); // "i" for case-insensitive matching
|
||||
// Escape special characters for use in the regular expression
|
||||
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
|
||||
const escapedSearchText = escapeRegExp(this.searchText);
|
||||
const regex = new RegExp(escapedSearchText, "i");
|
||||
|
||||
const safeRegexTest = (str) => str && regex.test(str);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue