Artificial truth

The more you see, the less you believe.

[archives] [latest] | [homepage] | [atom/rss/twitter]

Making dokuwiki's davcal plugin work with Dokuwiki Hogfather
Tue 11 August 2020 — download

Dokuwiki's latest relase, Hogfather, changed a bunch of stuff internally, breaking some plugins, amongst them the venerable davcal. This plugin shouldn't be used anymore, because it's unmaintained, full of low-hanging XSS, using old libraries, … but since you're reading this article, odds are that you want to make it work anyway, so here is the diff to apply:

+++ /var/www/wiki/lib/plugins/davcal/action/ajax.php
@@ -187,6 +187,7 @@

       // If we are still here, JSON output is requested

-      //json library of DokuWiki
-      require_once DOKU_INC . 'inc/JSON.php';
-      $json = new JSON();
-      //set content type
       header('Content-Type: application/json');
-      echo $json->encode($data);            
+      echo json_encode($data);