4 // Define ENABLE_RAW_HTML to true to enable the RawHtml plugin.
6 // IMPORTANT!!!: This plugin is currently insecure, as it's method of
7 // determining whether it was invoked from a locked page is flawed.
8 // (See the FIXME: comment below.)
10 // ENABLE AT YOUR OWN RISK!!!
12 if (!defined('ENABLE_RAW_HTML')) define('ENABLE_RAW_HTML', false);
15 * A plugin to provide for raw HTML within wiki pages.
17 class WikiPlugin_RawHtml
24 function run($dbi, $argstr, $request) {
25 if (!defined('ENABLE_RAW_HTML') || ! ENABLE_RAW_HTML) {
26 return $this->error(_("Raw HTML is disabled in this wiki."));
29 // FIXME: this test for lockedness is badly flawed. It checks
30 // the requested pages locked state, not the page the plugin
31 // invocation came from. (These could be different in the
32 // case of ActionPages, or where the IncludePage plugin is
34 $page = $request->getPage();
35 if (! $page->get('locked')) {
36 return $this->error(fmt(_("%s is only allowed in locked pages."),
40 return HTML::raw($argstr);
50 // c-hanging-comment-ender-p: nil
51 // indent-tabs-mode: nil