Escape url in Special:Log

When there is a "$1" in the url, it is treated like a message parameter
and replaced.

See https://www.wikidata.org/w/index.php?title=Special:Log&type=spamblacklist&page=Property:P2536.

Change-Id: Ia223a89e12c652a87d52a18c78e612b4b12871bc
This commit is contained in:
Matěj Suchánek 2017-01-22 10:49:28 +00:00
parent 776989d25f
commit 3d5392403b
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,11 @@
<?php
class SpamBlacklistLogFormatter extends LogFormatter {
protected function getMessageParameters() {
$params = parent::getMessageParameters();
$params[3] = Message::rawParam( htmlspecialchars( $params[3] ) );
return $params;
}
}

View file

@ -28,7 +28,7 @@
"spamblacklist": "spamblacklistlog" "spamblacklist": "spamblacklistlog"
}, },
"LogActionsHandlers": { "LogActionsHandlers": {
"spamblacklist/*": "LogFormatter" "spamblacklist/*": "SpamBlacklistLogFormatter"
}, },
"GrantPermissions": { "GrantPermissions": {
"viewrestrictedlogs": { "viewrestrictedlogs": {
@ -49,6 +49,7 @@
"EmailBlacklist": "EmailBlacklist.php", "EmailBlacklist": "EmailBlacklist.php",
"SpamBlacklistHooks": "SpamBlacklistHooks.php", "SpamBlacklistHooks": "SpamBlacklistHooks.php",
"SpamBlacklist": "SpamBlacklist_body.php", "SpamBlacklist": "SpamBlacklist_body.php",
"SpamBlacklistLogFormatter": "SpamBlacklistLogFormatter.php",
"SpamRegexBatch": "SpamRegexBatch.php", "SpamRegexBatch": "SpamRegexBatch.php",
"SpamBlacklistPreAuthenticationProvider": "SpamBlacklistPreAuthenticationProvider.php" "SpamBlacklistPreAuthenticationProvider": "SpamBlacklistPreAuthenticationProvider.php"
}, },