Compare commits

...

4 commits

Author SHA1 Message Date
Ionys
012256b297
Merge branch 'master' into feat-search-with-url 2024-12-23 12:09:25 +01:00
Ionys
c0d7171dbf fix(monitors search): Make sure regex expressions are escaped.
This can be reverted if the search should be regex friendly, but for the moment, it's not the case.
Thanks @homelab-alpha!
2024-12-23 12:08:35 +01:00
Louis Lam
be2faf64ce
Clarify that BSD OSs are not supported (#5465)
Some checks failed
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
2024-12-22 13:46:13 +08:00
Louis Lam
0b76e19401
Clarify that BSD OSs are not supported 2024-12-22 13:45:19 +08:00
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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);