Manual:$wgRawHtml/ru

Category:MediaWiki configuration settings/ru#RawHtmlCategory:MediaWiki configuration settings introduced in version 1.3.4/ru#RawHtmlCategory:MediaWiki configuration settings still in use/ru#RawHtmlCategory:HTML variables/ru#RawHtml
HTML: $wgRawHtml
Разрешить необработанный, непроверенный HTML в тегах <html>...</html>
Введено в версии:1.3.4
Удалено в версии:всё ещё используется
Допустимые значения:(логическое)
Значение по умолчанию:false

Подробнее

Когда $code вики позволит вам вставить необработанный HTML-код. Тем не менее, вы должны встроить свой html в теги <html>...</html>, чтобы MediaWiki могла его разграничить.

Внимание Внимание: This is very dangerous on a publicly editable site, because it allows for arbitrary JavaScript code to be inserted, opening the door for session hijacking. Thus, you shouldn't enable $wgRawHtml unless you've restricted editing to trusted users only with $wgGroupPermissions . See Руководство:Ограничение доступа for more information on restricting write access.
This option does not affect how wikicode outside of <html>...</html> tags is handled.
Версия MediaWiki:
1.29

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

Is enabling raw HTML necessary?

Some HTML tags are permitted in wikitext, even with $wgRawHtml = false. See Справка:HTML в вики-разметке. 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.

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:HTMLets unmaintained allows pre-defined HTML snippets with $wgRawHtml = false;
Extension:HTML Tags stableallows for adding HTML from a set of tags and attributes defined in the wiki's settings
Extension:Secure HTML unmaintainedadds 'Secret key' protection for html sections
Extension:SaferHTMLTag stable, has known security vulnerability prevents editing of pages that contain the ‎<html> tag by unauthorized users and groups
Extension:HTMLPurifier betaallows users to input raw HTML by using HTML Purifier to sanitize it
Extension:Widgets stableallows for defining HTML- and JavaScript-based "widgets", with optional parameters
Extension:HTMLTemplates experimentalCreates 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 own tag extension. Do not be tempted to develop an extension which allows arbitrary HTML, otherwise the same serious security issues apply as with setting $wgRawHtml = true.

Category:HTML variables/ru Category:MediaWiki configuration settings/ru Category:MediaWiki configuration settings introduced in version 1.3.4/ru Category:MediaWiki configuration settings still in use/ru