Well who would have thought I’d start writing DokuWiki plugins for a change. It’s a bit of a workaround plugin, due to an issue in a WordPress – DokuWiki login bridge that I’ve implemented. All wiki content was being escaped (addslashes), so that “you’re” became “you\’re”. I have yet to find a real solution for this, whether it is the bridge, or dokuwiki, but for the time being, I can move on without polluting the wiki pages by using this plugin:


[download id=”3″]

1 comment

  1. Jonathan Wagner

    I posted the following at keeyai's website as well, but just thought I'd post here to let those landing here looking for info.I too am experiencing the addslashes bug which seems to be stemming from wp-settings.php around line 630 in WordPress 2.9.1:// Escape with wpdb.$_GET = add_magic_quotes($_GET );$_POST = add_magic_quotes($_POST );$_COOKIE = add_magic_quotes($_COOKIE);$_SERVER = add_magic_quotes($_SERVER);Wrapping this with an if statement to check if the cookie is from Dokuwiki or somewhere else seems to fix the problem and I haven’t seen any adverse effects yet. The final code looks like:if (!$_COOKIE[DokuWiki]) {// Escape with wpdb.$_GET = add_magic_quotes($_GET );$_POST = add_magic_quotes($_POST );$_COOKIE = add_magic_quotes($_COOKIE);$_SERVER = add_magic_quotes($_SERVER);}Basically just skips WordPress’s slashing if the Get/Post/Cookie request comes from Dokuwiki.

Leave a Reply