Title: Making dokuwiki's davcal plugin work with Dokuwiki Hogfather
Date: 2020-08-11 16:15

Dokuwiki's latest relase, [Hogfather](https://www.dokuwiki.org/changes#release_2020-07-29_hogfather ), 
changed a bunch of stuff internally, breaking some plugins, amongst them the venerable [davcal]( https://www.dokuwiki.org/plugin:davcal ).
This plugin shouldn't be used anymore, because it's [unmaintained]( http://www.aboehler.at/hg/davcal/ ), [full of low-hanging XSS]( https://code.rnb-consulting.at/T51 ),
using [old libraries]( https://code.rnb-consulting.at/T47 ), … but since you're reading this article,
odds are that you want to make it work anyway, so here is the *diff* to apply:

```diff
+++ /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);
     }
  
 }
```
