diff --git a/module/api/control.php b/module/api/control.php index a88c015fae..35d6f389b9 100644 --- a/module/api/control.php +++ b/module/api/control.php @@ -58,36 +58,33 @@ class api extends control */ public function debug($filePath, $action) { - if($filePath) + $filePath = helper::safe64Decode($filePath); + if($action == 'extendModel') { - $filePath = helper::safe64Decode($filePath); - if($action == 'extendModel') - { - $method = $this->api->getMethod($filePath, 'Model'); - } - elseif($action == 'extendControl') - { - $method = $this->api->getMethod($filePath); - } - - if(!empty($_POST)) - { - $result = $this->api->request($method->className, $method->methodName, $action); - $content = json_decode($result['content']); - $status = $content->status; - $data = json_decode($content->data); - $data = '' . print_r($data, true) . ''; - - $response['result'] = 'success'; - $response['status'] = $status; - $response['url'] = $result['url']; - $response['data'] = $data; - $this->send($response); - } - - $this->view->method = $method; - $this->view->filePath = $filePath; - $this->display(); + $method = $this->api->getMethod($filePath, 'Model'); } + elseif($action == 'extendControl') + { + $method = $this->api->getMethod($filePath); + } + + if(!empty($_POST)) + { + $result = $this->api->request($method->className, $method->methodName, $action); + $content = json_decode($result['content']); + $status = $content->status; + $data = json_decode($content->data); + $data = '' . print_r($data, true) . ''; + + $response['result'] = 'success'; + $response['status'] = $status; + $response['url'] = $result['url']; + $response['data'] = $data; + $this->send($response); + } + + $this->view->method = $method; + $this->view->filePath = $filePath; + $this->display(); } } diff --git a/module/api/view/debug.html.php b/module/api/view/debug.html.php index 1fa937469d..54d3c2ee6d 100644 --- a/module/api/view/debug.html.php +++ b/module/api/view/debug.html.php @@ -31,7 +31,7 @@ api->submit)?> - +