From 730ec1292dbc18fd3dea3b7bcf6b2ed761e90964 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 11 Jan 2022 22:17:34 +0100 Subject: [PATCH] Use anchor in supplier regex (#3402) Adding a unit test to check the url patterns allowed/disallowed would be a good idea. I should practice what I preach. --- application/hooks/method_hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/hooks/method_hook.php b/application/hooks/method_hook.php index 805ba38f0..e00aada8d 100644 --- a/application/hooks/method_hook.php +++ b/application/hooks/method_hook.php @@ -5,7 +5,7 @@ function validate_method() $url = $_SERVER['REQUEST_URI']; - $post_required = preg_match('/(save|delete*|remove*)\/?\d*?/', $url); + $post_required = preg_match('/\/(save|delete*|remove*)\/?\d*?/', $url); if($post_required && $_SERVER["REQUEST_METHOD"] != "POST" && empty($_POST)) {