Merge branch 'json_decode' into dev

pull/1150/head
Alexandre Alapetite 9 years ago
commit 033f9695b4
  1. 8
      lib/lib_rss.php

@ -1,16 +1,16 @@
<?php <?php
if (!function_exists('json_decode')) { if (!function_exists('json_decode')) {
require_once('JSON.php'); require_once('JSON.php');
function json_decode($var) { function json_decode($var, $assoc = false) {
$JSON = new Services_JSON; $JSON = new Services_JSON($assoc ? SERVICES_JSON_LOOSE_TYPE : 0);
return (array)($JSON->decode($var)); return $JSON->decode($var);
} }
} }
if (!function_exists('json_encode')) { if (!function_exists('json_encode')) {
require_once('JSON.php'); require_once('JSON.php');
function json_encode($var) { function json_encode($var) {
$JSON = new Services_JSON; $JSON = new Services_JSON();
return $JSON->encodeUnsafe($var); return $JSON->encodeUnsafe($var);
} }
} }

Loading…
Cancel
Save