mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-15 23:07:45 -04:00
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:
1 parent
6e1db1458b
commit
730ec1292d
1 file changed
+1
-1
@@ -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))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user