From b67269a2023080445d11b6b135fff3d2b91d1634 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 25 Sep 2014 09:27:59 -0400 Subject: [PATCH] Dropped that dirty dirty XML support. --- src/classes/Display.php | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/classes/Display.php b/src/classes/Display.php index 66e72bc..be82a21 100644 --- a/src/classes/Display.php +++ b/src/classes/Display.php @@ -49,21 +49,6 @@ class Display extends Object $this->module->response = [$this->module->response]; } - $return_json = false; - $return_xml = false; - - foreach ($this->module->output as $return) - { - $variable = 'return_' . $return; - $$variable = true; - } - - // Makes sure the return type is valid - if (!$return_json && !$return_xml) - { - throw new Exception('Invalid return type.'); - } - // Checks for the PHPSESSID in the query string if (stripos($_SERVER['REQUEST_URI'], '?PHPSESSID=') === false) { @@ -96,17 +81,9 @@ class Display extends Object $response['response'] = $this->module->response; } - if ($return_json) - { - header('Content-type: application/json'); - $pretty = isset($_REQUEST['pretty']) ? JSON_PRETTY_PRINT : false; - echo json_encode($response, $pretty); - } - elseif ($return_xml) - { - header('Content-type: text/xml'); - echo Convert::arrayToXML($response, isset($_REQUEST['pretty'])); - } + header('Content-type: application/json'); + $pretty = isset($_REQUEST['pretty']) ? JSON_PRETTY_PRINT : false; + echo json_encode($response, $pretty); return ob_get_clean(); }