From 3c34e36be4aa741d182b948cc4ad3478e16c4c9e Mon Sep 17 00:00:00 2001 From: Frikky Date: Thu, 16 Nov 2023 19:51:56 +0100 Subject: [PATCH] Added catchall and str() for regex --- backend/app_sdk/app_base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 298be08f..9174cc0d 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -2803,9 +2803,12 @@ class AppBase: return False elif check.lower() == "re" or check.lower() == "matches regex": try: - found = re.search(destinationvalue, sourcevalue) + found = re.search(str(destinationvalue), str(sourcevalue)) except re.error as e: - print("[WARNING] Regex error in condition: %s" % e) + print("[WARNING] Regex error in condition (re.error): %s" % e) + return False + except Exception as e: + print("[WARNING] Regex error in condition (catchall): %s" % e) return False if found == None: