mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2025-12-24 10:07:52 -05:00
* Improve code style and PSR-12 compliance - refactored code formatting to adhere to PSR-12 guidelines - standardized coding conventions across the codebase - added missing framework files and reverted markup changes - reformatted arrays for enhanced readability - updated language files for consistent styling and clarity - minor miscellaneous improvements
22 lines
421 B
PHP
22 lines
421 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
class Method
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public static function validate_method(): void
|
|
{
|
|
$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;
|
|
}
|
|
}
|
|
}
|