Hi All,
I had a look at the plugin and I found out that it uses a no longer supported function. My apache error log showed the following line:
[Mon Jun 12 22:37:20.877899 2017] [:error] [pid 5306] [client 127.0.0.1:43988] PHP Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/lars/public-html/dokuwiki/lib/plugins/randominc/helper.php on line 432
You can fix it this way: open the file
helper.php, go to line
421. You should see this function:
/**
* Remove TOC, section edit buttons and tags
*/
function _cleanXHTML($xhtml){
$replace = array(
'!<div class="toc">.*?(</div>\n</div>)!s' => '', // remove toc
'#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#e' => '', // remove section edit buttons
'!<div class="tags">.*?(</div>)!s' => '', // remove category tags
);
if ($this->clevel)
$replace['#<div class="footnotes">#s'] = '<div class="footnotes level'.$this->clevel.'">';
$xhtml = preg_replace(array_keys($replace), array_values($replace), $xhtml);
return $xhtml;
}
Replace the function with this code:
/**
* Remove TOC, section edit buttons and tags
*/
function _cleanXHTML($xhtml){
$replace = array(
'!<div class="toc">.*?(</div>\n</div>)!s' => '', // remove toc
'#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#' => '', // remove section edit buttons
'!<div class="tags">.*?(</div>)!s' => '', // remove category tags
);
if ($this->clevel)
$replace['#<div class="footnotes">#s'] = '<div class="footnotes level'.$this->clevel.'">';
$xhtml = preg_replace_callback(array_keys($replace),
function ($m) { return ''; },
$xhtml);
return $xhtml;
}
The code above needs a cleanup but it seemed tow work on my installation. So the problem seems th be related to the PHP version, not the DokWiki version. Did you also upgrade the PHP version?
To be more precise
preg_replace(...)[/m] is still supported but not the option [m]e[/m] (as used in the line [m]'#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#e').
Please check out the code and give some feedback.
Kind Regards,
Lars