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 +?>