summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/rest/helpers/rest.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php
index 3c53784d..1ee72aed 100644
--- a/modules/rest/helpers/rest.php
+++ b/modules/rest/helpers/rest.php
@@ -23,9 +23,13 @@ class rest_Core {
if (Input::instance()->get("output") == "html") {
header("Content-type: text/html");
- $html = preg_replace(
- "#([\w]+?://[\w]+[^ \'\"\n\r\t<]*)#ise", "'<a href=\"\\1\" >\\1</a>'",
- var_export(!empty($data) ? $data : t("Empty response"), 1));
+ if ($data) {
+ $html = preg_replace(
+ "#([\w]+?://[\w]+[^ \'\"\n\r\t<]*)#ise", "'<a href=\"\\1\" >\\1</a>'",
+ var_export($data, 1));
+ } else {
+ $html = t("Empty response");
+ }
print "<pre>$html</pre>";
} else {
header("Content-type: application/json");