update descartes
This commit is contained in:
parent
54e4f365e5
commit
4efccf4c2f
|
@ -8,7 +8,7 @@
|
||||||
/**
|
/**
|
||||||
* Cette fonction construit la classe, elle prend en paramètre obligatoire le type de méthode (PUT, GET, POST, etc) avec laquel on a appelée la page
|
* Cette fonction construit la classe, elle prend en paramètre obligatoire le type de méthode (PUT, GET, POST, etc) avec laquel on a appelée la page
|
||||||
*/
|
*/
|
||||||
public function __construct() : void
|
public function __construct()
|
||||||
{
|
{
|
||||||
//On va choisir le type à employer
|
//On va choisir le type à employer
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
|
|
@ -198,11 +198,14 @@
|
||||||
default :
|
default :
|
||||||
$prefix_method = 'get_';
|
$prefix_method = 'get_';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If we dont match prefix with request method, return error
|
||||||
|
if (mb_substr($method, 0, mb_strlen($prefix_method)) != $prefix_method)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$prefix_method = $prefix_method ?? '';
|
|
||||||
|
|
||||||
|
|
||||||
$method = $prefix_method . $method;
|
|
||||||
if (!method_exists($controller, $method))
|
if (!method_exists($controller, $method))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue