Extension:TitleBlacklist/ja

The TitleBlacklist extension allows wiki administrators to block the creation, movement and upload of pages, the title of which matches one or more regular expressions, as well as blocking creation of accounts with matching usernames.

設定

 * Array of title blacklist sources.
 * Should be in array( name => source description ) format. Defaults to an empty array.
 * Should be in array( name => source description ) format. Defaults to an empty array.


 * Sets the sources which may work as a username filter.
 * '*' is for all; false disables all.
 * If you want to limit it to particular sources, use array( source name 1, source name 2 ). This may be useful when you have shared account creation system in order to avoid blacklist fragmentation.
 * If you want to limit it to particular sources, use array( source name 1, source name 2 ). This may be useful when you have shared account creation system in order to avoid blacklist fragmentation.


 * When true, logs on Special:Log/titleblacklist all attempts of local account creation that match the blacklists. Defaults to . Note that even disabled, the log will still be visible for users groups with the   right.
 * When true, logs on Special:Log/titleblacklist all attempts of local account creation that match the blacklists. Defaults to . Note that even disabled, the log will still be visible for users groups with the   right.




 * Also blocks account created automatically that match the blacklists. Defaults to.
 * Also blocks account created automatically that match the blacklists. Defaults to.

The title block list can be gathered from multiple sources outside the local message. For configuring block list sources use code as described below:
 * Multiple block list sources:

See issue T113864 for further information.

ブロックリスト
タイトルブロックリストはMediaWiki:Titleblacklistのページに保存されています.

このページはそれぞれの個別の行ごとに正規表現で構成されます. 例：

 Foo  #This page name is not allowed [Bb]ar #No one should create article about it .*pandora.* #This word is not allowed in any part of a page name

それぞれのエントリは  で閉じられ、  で分割されたオプションの属性を含むことができます.
 * autoconfirmed - 自動承認された利用者にのみ操作を許可します
 * casesensitive - ブラックリストに掲載されたタイトルを確認するときに大文字小文字の区別をする
 * noedit - 利用者はこの記事を編集できません
 * moveonly - 作成はできますが、移動はできません (rev:35163)
 * newaccountonly - マッチする利用者名でアカウントを作成することはできませんが、ページの作成はできます (rev:38977)
 * reupload - ブラックリストに掲載されたファイルの再アップロードを許可 (rev:33656)
 * errmsg - 標準のものの代わりに表示されるメッセージの名前です

拡張機能がインストールされている場合、属性  を使用することができます.

ここで「正規表現」として説明しているものは正式な正規表現ではなく、ハードコードされた正規表現パターンに挿入するためのサブパターンです. 例えば、上記の例にあるFooは/^Foo$/usiのような正規表現になります.

正規表現にアンダースコア(" ")が含まれる場合、拡張機能により自動的にスペースに変換されます. これはタイトルの検査がテキスト形式（"Page_title"ではなく、"Page title"の形）で行われるためです.

ホワイトリスト
MediaWiki:Titlewhitelistというホワイトリストもあります. 順番としてはまずブラックリストが、続いてホワイトリストが適用されます. したがって、ブラックリストの正規表現に合致し、ホワイトリストの正規表現に合致しない入力はブロックされます. なお、ホワイトリストの使用にあたってLocalSettings.phpを変更する必要はありません. 上記ブラックリスト向けの属性の一部（casesensitiveなど）はホワイトリストでも使用できます.

カスタマイズ

 * 警告メッセージ

When an attempt to create a page is blocked due to a title being listed on the block list, a warning message is shown to the user. This can be customized via system messages
 * MediaWiki:Titleblacklist-forbidden-edit: for page creation and editing,
 * MediaWiki:Titleblacklist-forbidden-move: for page moves,
 * MediaWiki:Titleblacklist-forbidden-upload: for image uploads.
 * MediaWiki:Titleblacklist-forbidden-new-account: for new accounts

カスタムメッセージは errmsg属性を使用して定義できます.

Conceptual overview
The username for new accounts will be regarded by this extension differently to the way it regards new articles. This extension will prepend "User:" (or its localized equivalent) to the string that a user enters at  on the create account page. So when this extension is performing matches with your Regex's, as found on MediaWiki:Titleblacklist or MediaWiki:Titlewhitelist, it will match against "User:" +.

For example, imagine you want to block "jill" as a new user. Imagine you had a block list regex "jill.* " and a user enters "jill" as the username on the create account page. This will pass as the comparison this extension will make will be between "jill.*" (the regex) and "User:jill" (the constructed input string). These don't match and so "jill" is allowed (and you probably didn't intend this). To effect the intended block use a regex like ".*jill.* " or "User:jill.* " on MediaWiki:Titleblacklist.

If you want to block all users except for all those that do match a regex then block all users in MediaWiki:Titleblacklist and write the permissible regex in the MediaWiki:Titlewhitelist.

How to
If you would like to force all usernames, during account creation, to consist of exactly two names, space separated, with each name capitalized then do the following:

1. TitleBlackListをインストールします.

2. 以下を に追加します

3. In https://www.example.com/mywiki/MediaWiki:Titleblacklist add

4. In https://www.example.com/mywiki/MediaWiki:Titlewhitelist add

5. In https://www.example.com/mywiki/MediaWiki:Titleblacklist-forbidden-new-account edit

 The user name "$2" has been blocked from creation. It matches the following block list entry:.

Please use a real name for the user name. User names need to be comprised of two names separated by a space. Each name must be capitalized.

E.g.:
 * "Mary Smith". OK.
 * "MarySmith". Invalid.
 * "Mary smith". Invalid.
 * "marysmith". Invalid.

User name creation (and article creation) blocking rules are controlled by MediaWiki:Titleblacklist and MediaWiki:Titlewhitelist. This message can be customized at MediaWiki:Titleblacklist-forbidden-new-account

Testing for matches
The API module action=titleblacklist can be used to test a title and action (e.g. edit, create, new-account) against the block list. Users with the 'tboverride' right should be sure to supply the  parameter.

For example, if the block list contained the filter:

.*(.)\1{10}.*  # Disallows eleven or more of the same character repeated in usernames

you could use an API request like {{ApiEx ",       "message": "titleblacklist-forbidden-new-account-invalid",        "line": ".*(.)\1{10}.* &lt;newaccountonly|errmsg=titleblacklist-forbidden-new-account-invalid&gt; # Disallows eleven or more of the same character repeated in usernames"    } } }}
 * p1=action=titleblacklist
 * p2=tbtitle=AAAAAAAAAAA
 * p3=tbaction=new-account
 * p4=tbnooverride=1
 * result=

If Scribunto is installed, this extension allows for testing if particular titles and actions will match an entry in the block list using the  function. If a match is found, the details for the matched entry are returned.

For example, if the block list contained the filter:

.*(.)\1{10}.*  # Disallows eleven or more of the same character repeated in usernames

running the function:

would return the following table containing details about the matched entry:

Resources on regular expressions

 * Brief Introduction to Regular Expressions
 * https://web.archive.org/web/20050213032350/http://etext.lib.virginia.edu/services/helpsheets/unix/regex.html
 * The 30 Minute Regex. Tutorial
 * http://www.codeproject.com/Articles/9099/The-Minute-Regex-Tutorial
 * PHP: PCRE regex syntax, the syntax of regular expressions used by PHP &mdash; and therefore this extension
 * https://php.net/reference.pcre.pattern.syntax

関連項目

 * Combating spam and combating vandalism.