2 rcs_id('$Id: RawHtml.php,v 1.8 2003-11-22 17:50:32 carstenklapp Exp $');
4 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
6 This file is part of PhpWiki.
8 PhpWiki is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 PhpWiki is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with PhpWiki; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 // Define ENABLE_RAW_HTML to false (in index.php) to disable the RawHtml plugin.
25 if (!defined('ENABLE_RAW_HTML'))
26 define('ENABLE_RAW_HTML', true);
29 * A plugin to provide for raw HTML within wiki pages.
31 class WikiPlugin_RawHtml
38 function getDescription () {
39 return _("A plugin to provide for raw HTML within wiki pages.");
42 function getVersion() {
43 return preg_replace("/[Revision: $]/", '',
47 function managesValidators() {
48 // The plugin output will only change if the plugin
49 // invocation (page text) changes --- so the necessary
50 // validators have already been handled by displayPage.
54 function run($dbi, $argstr, &$request, $basepage) {
55 if (!defined('ENABLE_RAW_HTML') || ! ENABLE_RAW_HTML) {
56 return $this->disabled(_("Raw HTML is disabled in this wiki."));
59 return $this->error("$basepage unset?");
62 $page = $request->getPage($basepage);
64 if (! $page->get('locked')) {
65 return $this->disabled(fmt("%s is only allowed in locked pages.",
69 return HTML::raw($argstr);
73 // $Log: not supported by cvs2svn $
74 // Revision 1.7 2003/03/17 22:32:26 dairiki
75 // Minor HTTP caching fix.
77 // Revision 1.6 2003/03/17 21:24:53 dairiki
78 // Fix security bugs in the RawHtml plugin.
80 // Change the default configuration to allow use of plugin, since
81 // I believe the plugin is now safe for general use. (Raw HTML will only
82 // work on locked pages.)
84 // Revision 1.5 2003/01/18 22:01:43 carstenklapp
86 // Reformatting & tabs to spaces;
87 // Added copyleft, getVersion, getDescription, rcs_id.
95 // c-hanging-comment-ender-p: nil
96 // indent-tabs-mode: nil