mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-13 21:04:46 +00:00
Compare commits
5 commits
510bb9e551
...
0664431d0d
Author | SHA1 | Date | |
---|---|---|---|
|
0664431d0d | ||
|
012256b297 | ||
|
c0d7171dbf | ||
|
be2faf64ce | ||
|
0b76e19401 |
2 changed files with 6 additions and 1 deletions
|
@ -62,6 +62,7 @@ Requirements:
|
|||
- Platform
|
||||
- ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc.
|
||||
- ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher
|
||||
- ❌ FreeBSD / OpenBSD / NetBSD
|
||||
- ❌ Replit / Heroku
|
||||
- [Node.js](https://nodejs.org/en/download/) 18 / 20.4
|
||||
- [npm](https://docs.npmjs.com/cli/) 9
|
||||
|
|
|
@ -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