AJAX requests can only use the POST method
This commit is contained in:
parent
37e5b2328f
commit
cd1d62d8d7
|
|
@ -349,6 +349,10 @@ class Controller extends Extendable
|
|||
*/
|
||||
protected function execAjaxHandlers()
|
||||
{
|
||||
if (Request::method() != 'POST') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($handler = trim(Request::header('X_OCTOBER_REQUEST_HANDLER'))) {
|
||||
try {
|
||||
/*
|
||||
|
|
@ -363,16 +367,6 @@ class Controller extends Extendable
|
|||
*/
|
||||
if ($partialList = trim(Request::header('X_OCTOBER_REQUEST_PARTIALS'))) {
|
||||
$partialList = explode('&', $partialList);
|
||||
|
||||
// @todo Do we need to validate backend partials?
|
||||
// foreach ($partialList as $partial) {
|
||||
// if (!preg_match('/^(?:\w+\:{2}|@)?[a-z0-9\_\-\.\/]+$/i', $partial)) {
|
||||
// throw new SystemException(Lang::get(
|
||||
// 'cms::lang.partial.invalid_name',
|
||||
// ['name' => $partial]
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else {
|
||||
$partialList = [];
|
||||
|
|
|
|||
|
|
@ -572,6 +572,10 @@ class Controller
|
|||
*/
|
||||
protected function execAjaxHandlers()
|
||||
{
|
||||
if (Request::method() != 'POST') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($handler = trim(Request::header('X_OCTOBER_REQUEST_HANDLER'))) {
|
||||
try {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue