Skip to content

Commit

Permalink
Make json rendering function compatible with PHP < 5.3.0 [#4 state:re…
Browse files Browse the repository at this point in the history
…solved]
  • Loading branch information
Fabrice Luraine committed May 28, 2009
1 parent 0873fa0 commit f25a774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/limonade.php
Expand Up @@ -1262,7 +1262,7 @@ function txt($content_or_func, $layout = '', $locals = array())
function json($data, $json_option = 0)
{
header('Content-Type: application/x-javascript; charset='.strtolower(option('encoding')));
return json_encode($data, $json_option);
return version_compare(PHP_VERSION, '5.3.0', '>=') ? json_encode($data, $json_option) : json_encode($data);
}

/**
Expand Down

0 comments on commit f25a774

Please sign in to comment.