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.
This commit is contained in:
jekkos
2022-01-11 22:17:34 +01:00
parent 6e1db1458b
commit 730ec1292d

View File

@@ -5,7 +5,7 @@ function validate_method()
$url = $_SERVER['REQUEST_URI']; $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)) if($post_required && $_SERVER["REQUEST_METHOD"] != "POST" && empty($_POST))
{ {