From 2ecde0e90c60e48ae84ca625d0605de2f9ac4528 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 1 Feb 2021 20:29:10 +0100 Subject: [PATCH] Add leading and trailing slashes to the search regex field (if not empty) automatially MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without, you cant copy/paste a regex from the tester or from somewhere else as it misses the required slashes. This drives you nuts if you don“t know --- inc/getlog.pml.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/getlog.pml.php b/inc/getlog.pml.php index 694a3e45..917e6a1e 100644 --- a/inc/getlog.pml.php +++ b/inc/getlog.pml.php @@ -106,6 +106,13 @@ function shutdown() $search = @$_POST['search']; $old_lastline = @$_POST['lastline']; +// adds leading and trailing slashes to the search regex field (if not empty) automatially +// without, you cant copy/paste a regex from the tester as it misses the required slashes. +if (!empty($search)) { + $search = trim($search, '/'); + $search = '/' . $search . '/'; +} + header('Content-type: application/json'); if ( ! csrf_verify() ) { @@ -309,4 +316,4 @@ function shutdown() die(); -?> \ No newline at end of file +?>