diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-21 14:41:05 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-21 14:41:05 -0800 |
commit | 9f810150532a2511bfc5f03c9d24fd592d2f803f (patch) | |
tree | 7e4c1d8547b1eb3977f5b634270d51334f4fe910 /modules/rest/helpers/rest.php | |
parent | a6c3e8f0a26661afd353c75bea496532999f2ca5 (diff) | |
parent | be20309259de9310da3be703c93c4e42def2541b (diff) |
Merge branch 'master' into talmdal_dev
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"); |