From: Andrey Kutejko Date: Tue, 6 Jan 2015 09:31:37 +0000 (+0200) Subject: component reorder: check http method in routes X-Git-Tag: 0.6~88 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=13fc27f2a89d5c9843695c2e5403db896b8e300f;p=ipf.git component reorder: check http method in routes --- diff --git a/ipf/admin/app.php b/ipf/admin/app.php index 27f8f52..035bde5 100644 --- a/ipf/admin/app.php +++ b/ipf/admin/app.php @@ -21,7 +21,7 @@ class IPF_Admin_App extends IPF_Application )), array('controller' => 'IPF_Admin_Components_Controller', 'urls' => array( array('regex' => '([\w\_\-]+)/([\w\_\-]+)/$#i', 'func' => 'listItems'), - array('regex' => '([\w\_\-]+)/([\w\_\-]+)/reorder/$#i', 'func' => 'reorder'), + array('regex' => '([\w\_\-]+)/([\w\_\-]+)/reorder/$#i', 'func' => 'reorder', 'method' => 'POST'), array('regex' => '([\w\_\-]+)/([\w\_\-]+)/add/$#i', 'func' => 'addItem'), array('regex' => '([\w\_\-]+)/([\w\_\-]+)/([\w\_\-]+)/$#i', 'func' => 'editItem'), array('regex' => '([\w\_\-]+)/([\w\_\-]+)/([\w\_\-]+)/delete/$#i', 'func' => 'deleteItem'), diff --git a/ipf/admin/controllers/components.php b/ipf/admin/controllers/components.php index 89954d3..268333f 100644 --- a/ipf/admin/controllers/components.php +++ b/ipf/admin/controllers/components.php @@ -42,7 +42,7 @@ class IPF_Admin_Components_Controller extends IPF_Admin_Base_Controller { $component = $this->getComponent(array('view', 'change')); - if ($this->request->method != 'POST' || !isset($this->request->POST['ids']) || !is_array($this->request->POST['ids'])) + if (!isset($this->request->POST['ids']) || !is_array($this->request->POST['ids'])) return new IPF_HTTP_Response_NotFound($request); if ($component->reorder($this->request->POST['ids']))