summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-01 16:55:41 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-01 16:55:41 +0100
commit0c6142dad2aa645aa202e72814070d1f47bd9158 (patch)
tree96f77186bfe1de98fbd060c35ae8c531a0cf070b /lib/lib_rss.php
parentb69ad41c40d50476e685e2d9edd75110d89a785d (diff)
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
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php16
1 files changed, 16 insertions, 0 deletions
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 @@
<?php
+if (!function_exists('json_decode')) {
+ require_once('JSON.php');
+ function json_decode($var) {
+ $JSON = new Services_JSON;
+ return $JSON->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;