diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-21 13:08:06 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-21 13:08:06 -0800 |
commit | be20309259de9310da3be703c93c4e42def2541b (patch) | |
tree | 38ecbb4fe4183e65af79cd9fbdfae3d99b8cd4d3 /modules/rest/helpers/rest.php | |
parent | cb57c3912aef6bed394a4693f94e9c97001aff34 (diff) | |
parent | 1377b2c7b3110a132d4b2d748be72a6aafa537e6 (diff) |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/rest/helpers/rest.php')
-rw-r--r-- | modules/rest/helpers/rest.php | 10 |
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"); |