mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-19 23:07:57 -05:00
- 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
23 lines
356 B
PHP
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;
|
|
}
|
|
}
|
|
}
|