summaryrefslogtreecommitdiff
path: root/modules/rest/helpers/rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-02-20 10:24:29 -0800
committerBharat Mediratta <bharat@menalto.com>2010-02-20 10:24:29 -0800
commit1377b2c7b3110a132d4b2d748be72a6aafa537e6 (patch)
tree56f90e50bee3ea37a65a00a47a015468b2ab24a2 /modules/rest/helpers/rest.php
parentf4fc245603fc8ec1bb9536356c8d4ab017153c08 (diff)
When using rest::reply(), don't call var_export() if the response is empty.
Diffstat (limited to 'modules/rest/helpers/rest.php')
-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");