From 0c6142dad2aa645aa202e72814070d1f47bd9158 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 1 Dec 2013 16:55:41 +0100 Subject: PHP : JSON alternative Utilise http://pear.php.net/package/Services_JSON si les fonctions json_* native de PHP ne sont pas disponibles Pour https://github.com/marienfressinaud/FreshRSS/issues/306 --- lib/lib_rss.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 93fa48af0..e3deb9792 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -1,4 +1,20 @@ decode($var); + } +} + +if (!function_exists('json_encode')) { + require_once('JSON.php'); + function json_encode($var) { + $JSON = new Services_JSON; + return $JSON->encode($var); + } +} + // vérifie qu'on est connecté function is_logged () { return Session::param ('mail') != false; -- cgit v1.2.3