Skip to content

Commit

Permalink
Merge pull request #81 from tyzoid/master
Browse files Browse the repository at this point in the history
Fix compatability with PHP5.3
  • Loading branch information
jacwright committed Dec 20, 2016
2 parents adfa146 + 6288f32 commit 584aa06
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/Jacwright/RestServer/RestServer.php
Expand Up @@ -428,10 +428,14 @@ public function sendData($data)
}
}
$options = 0;
if ($this->mode == 'debug') {
if ($this->mode == 'debug' && defined('JSON_PRETTY_PRINT')) {
$options = JSON_PRETTY_PRINT;
}
$options = $options | JSON_UNESCAPED_UNICODE;

if (defined('JSON_UNESCAPED_UNICODE')) {
$options = $options | JSON_UNESCAPED_UNICODE;
}

echo json_encode($data, $options);
}
}
Expand Down

0 comments on commit 584aa06

Please sign in to comment.