mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-10 09:59:08 -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:
@@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user