Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:$wgRawHtml

From mediawiki.org
Translate this page
Languages:
HTML: $wgRawHtml
Allow raw, unchecked HTML in‎<html>...‎</html> sections.
Introduced in version:1.3.4
Removed in version:Still in use
Allowed values:(boolean)
Default value:false
Other settings:Alphabetical |By function

Details

[edit]

Insert$wgRawHtml=true; into the fileLocalSettings.php in your main MediaWiki directory and the wiki will allow you to insert raw unchecked HTML.However, you must embed your HTML within the‎<html>...‎</html> tags so that MediaWiki can differentiate it.

WarningWarning:This is very dangerous on a publicly editable site, because it allows for arbitrary JavaScript code to be inserted, opening the door forsession hijacking. Thus, you shouldn't enable$wgRawHtml unless you've restricted editing to trusted users only with$wgGroupPermissions. SeeManual:Preventing access for more information on restricting write access.
This option doesnot affect how wikicode outside of‎<html>...‎</html> tags is handled.
MediaWiki version:
1.29

SinceMediaWiki 1.29, the raw HTML tag has no effect in namespace 8 (MediaWiki):phabricator:T156184.

Is enabling raw HTML necessary?

[edit]

Some HTML tags are permitted in wikitext, even with$wgRawHtml=false.SeeHelp:HTML in wikitext.The vast majority of fancy formatting seen on Wikimedia sites is achieved using these limited tags (e.g. tables with CSS style tags).If you can make do with these limitations (leave$wgRawHtml=false), your wiki will be more secure.

Also note that the "limited" wiki syntax is actually a deliberate design feature of wikis.It is a compact simplified markup which is easily understood even by non-technical users, easily visualised in diff displays, and discourages stylistic tinkering in favor of getting on with writing useful/interesting text.

Related Extensions

[edit]

There are a number of extensions which promise to allow more HTML flexibility, while improving the security situation.Some require setting$wgRawHtml=true in conjunction with using the extension, while others offer an alternative.


ExtensionStatusDescription
Extension:HTMLetsunmaintainedallows pre-defined HTML snippets with$wgRawHtml=false;
Extension:HTML Tagsstableallows for adding HTML from a set of tags and attributes defined in the wiki's settings
Extension:Secure HTMLunmaintainedadds 'Secret key' protection for html sections
Extension:SaferHTMLTagstable, has known security vulnerabilityprevents editing of pages that contain the ‎‎<html> tag by unauthorized users and groups
Extension:HTMLPurifierbetaallows users to input raw HTML by using HTML Purifier to sanitize it
Extension:Widgetsstableallows for defining HTML- and JavaScript-based "widgets", with optional parameters
Extension:HTMLTemplatesexperimentalCreates a new HTMLTemplate namespace like normal templates except written in HTML. Parameters are automatically escaped in a context sensitive manner


Another way get custom HTML appearing within your wiki articles is to develop your owntag extension.Donot be tempted to develop an extension which allows arbitrary HTML, otherwise the same serious security issues apply as with setting$wgRawHtml=true.

Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:$wgRawHtml&oldid=7741541"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp