mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-10 01:51:02 -04:00
Porting over e8f27f5
This commit is contained in:
committed by
Steve Ireland
parent
490c8e2662
commit
b840fdd01d
@@ -69,4 +69,4 @@ Events::on('post_controller_constructor', ['Load_config', 'load_config']); //TOD
|
||||
|
||||
Events::on('post_controller', ['Db_log', 'db_log_queries']);
|
||||
|
||||
Events::on('pre_controller', ['Save', 'validate_save']);
|
||||
Events::on('pre_controller', ['Method', 'validate_method']);
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
class Save
|
||||
class Method
|
||||
{
|
||||
public static function validate_save()
|
||||
public static function validate_method()
|
||||
{
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$post_required = preg_match('/\/(logout|save|delete*|remove*)\/?\d*?/', $url);
|
||||
$post_required = preg_match('/(save|delete|delete_item)\/?\d*?/', $url);
|
||||
|
||||
if($post_required && $_SERVER["REQUEST_METHOD"] != "POST" && empty($_POST))
|
||||
{
|
||||
Reference in New Issue
Block a user