From 1d739e3d75d38ff8d9a4b56dd3a6ff2457c7add3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= <grosse@cosmocode.de>
Date: Thu, 29 Mar 2018 16:41:12 +0200
Subject: [PATCH] refactor: use native json_encode for $JSINFO

json_encode is available natively since PHP 5.2
---
 inc/template.php | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/inc/template.php b/inc/template.php
index 75f2c1245..3d502e74f 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -324,14 +324,12 @@ function tpl_metaheaders($alt = true) {
         'href'=> DOKU_BASE.'lib/exe/css.php?t='.rawurlencode($conf['template']).'&tseed='.$tseed
     );
 
-    // make $INFO and other vars available to JavaScripts
-    $json   = new JSON();
     $script = "var NS='".$INFO['namespace']."';";
     if($conf['useacl'] && $INPUT->server->str('REMOTE_USER')) {
         $script .= "var SIG='".toolbar_signature()."';";
     }
     _tpl_ensureJSINFO();
-    $script .= 'var JSINFO = '.$json->encode($JSINFO).';';
+    $script .= 'var JSINFO = ' . json_encode($JSINFO).';';
     $head['script'][] = array('type'=> 'text/javascript', '_data'=> $script);
 
     // load jquery
-- 
GitLab