Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Json response fix for CLI

givanzb6166739ae05
diff --git a/system/core/response.php b/system/core/response.php
index a76251c..85c4ba2 100755
--- a/system/core/response.php
+++ b/system/core/response.php
@@ -83,10 +83,10 @@ class Response {
}
}
- if ($this->type == 'text') {
+ if ($this->type == 'text' && $data) {
echo $data;
} else {
- if ($this->type == 'json') {
+ if ($this->type == 'json' && $data && (! defined('CLI'))) {
if (is_array($data)) {
echo json_encode($data);
} else {