Manual:$wgRawHtml

This page is a translated version of the page Manual:$wgRawHtml and the translation is 66% complete.
HTML: $wgRawHtml
‎<html>...‎</html> セクション内で未整形・未確認の HTML を使用できるようにする。
導入されたバージョン:1.3.4
除去されたバージョン:使用中
許容される値:(真偽値)
既定値:false

詳細

MediaWikiディレクトリのファイル「LocalSettings.php」に「$wgRawHtml = true;」を挿入すると、WikiでチェックされていないHTMLを挿入できます。 しかし、htmlコードは ‎<html>...‎</html> タグ内に記してMediaWikiが識別できるようにしてください。

  警告: 誰でも編集できるサイトの場合、これは大変危険です。なぜなら任意のJavaScriptコードを挿入し、セッションハイジャックの扉を開くことができてしまうからです。 だから、$wgGroupPermissions の設定で信頼されたユーザだけに編集を制限していない限り、RawHtmlを有効にすべきではありません。 書き込みアクセスの制限についてより詳しくは Manual:アクセス制限 を参照してください。
このオプションは ‎<html>...‎</html> タグの外に記されたウィキコードの扱いには影響しません
MediaWiki バージョン:
1.29

MediaWiki 1.29以降、未加工のHTMLタグは名前空間8(MediaWiki)には影響しなくなりました: phabricator:T156184.

未加工HTMLの有効化は必要ですか?

一部の HTMLタグは、$wgRawHtml = false が設定されていてもウィキテキスト内で使うことができます。 Help: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.

関連する拡張機能

セキュリティ状態を改善しつつHTMLをより柔軟にしてくれる拡張機能がいくつかあります。 拡張機能を使う際、$wgRawHtml = true を設定する必要があるものもあれば、代替の方法を提供するものもあります。

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.