Files
opensourcepos/app/Events/Method.php
objecttothis ba9bcd7786 PHPdocs
- Added missing PHPdocs
- Corrected Syntax
- Added noinspection parameters to PHPdoc for AJAX called functions
- Added missing function return types
- Added missing parameter types
- Added public keyword to functions without visibility modifier
- Corrected incorrectly formatted PHPdocs
- Added public to constants and functions missing a visibility keyword
2024-06-15 17:19:15 +02:00

23 lines
356 B
PHP

<?php
namespace App\Events;
class Method
{
/**
* @return void
*/
public static function validate_method()
{
$url = $_SERVER['REQUEST_URI'];
$post_required = preg_match('/\/(save|delete*|remove*)\/?\d*?/', $url);
if($post_required && $_SERVER["REQUEST_METHOD"] != "POST" && empty($_POST))
{
echo "Method not allowed";
die;
}
}
}