From MediaWiki.org
Jump to: navigation, search

Other languages:
العربية • ‎català • ‎Deutsch • ‎English • ‎British English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎sicilianu • ‎中文
MediaWiki extensions manual
Crystal Clear action run.png

Release status: Unmaintained

Implementation Tag
Description Used to securely insert HTML section(s) on a wiki page.
Author(s) Jean-Lou Dupont (Jlduponttalk)
Latest version 1.1
MediaWiki tested on 1.8.2, 1.9.3
License No license specified
Download addHTML.php and ExtensionClass.php

Translate the AddHTML extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Features[edit | edit source]

  • Secure: Only people who can edit 'protected' pages (sysops) can use the tag
  • Inserts HTML code section either through:
    • inline code without the tagged section e.g. <addhtml> code here </addhtml>
    • or through PHP code
  • Parser Cache friendly

Limitation[edit | edit source]

The tag can only be used on pages which are 'protected', which means you might be forced to protect a page in order to use some HTML, which otherwise you would permit open editing on.

The extension currently does not work with current versions of MediaWiki. See Thread:Project:Support_desk/Problem_after_modify_server for more information.

Example1[edit | edit source]

<addhtml id=xyz /> and use an extension such as <runphp> to populate the section # 'xyz' with HTML code.

Example2[edit | edit source]

<script type="text/javascript">
function disp_prompt()
  var name=prompt("Please enter your name","t3h h4x0r")
  if (name!=null && name!="")
    document.write("Hello " + name + "! How are you today?")
<input type="button" onclick="disp_prompt()" value="CLICK!" />

<table border=0><tr><td>Anand</td><td>Sharma</td></tr></table>


Security[edit | edit source]

Pages where 'addhtml' is used must be protected or else an 'unauthorized use of addhtml' message will be displayed. If you have several 'sysop' users, you must trust them all not to abuse this feature.

Changes to LocalSettings.php[edit | edit source]