Matěj Suchánek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333484 )

Change subject: Escape url in Special:Log
......................................................................

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
---
A SpamBlacklistLogFormatter.php
M extension.json
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamBlacklist 
refs/changes/84/333484/2

diff --git a/SpamBlacklistLogFormatter.php b/SpamBlacklistLogFormatter.php
new file mode 100644
index 0000000..187ec1a
--- /dev/null
+++ b/SpamBlacklistLogFormatter.php
@@ -0,0 +1,11 @@
+<?php
+
+class SpamBlacklistLogFormatter extends LogFormatter {
+
+       protected function getMessageParameters() {
+               $params = parent::getMessageParameters();
+               $params[3] = Message::rawParam( htmlspecialchars( $params[3] ) 
);
+               return $params;
+       }
+
+}
\ No newline at end of file
diff --git a/extension.json b/extension.json
index d30d303..d12b061 100644
--- a/extension.json
+++ b/extension.json
@@ -28,7 +28,7 @@
                "spamblacklist": "spamblacklistlog"
        },
        "LogActionsHandlers": {
-               "spamblacklist/*": "LogFormatter"
+               "spamblacklist/*": "SpamBlacklistLogFormatter"
        },
        "GrantPermissions": {
                "viewrestrictedlogs": {
@@ -49,6 +49,7 @@
                "EmailBlacklist": "EmailBlacklist.php",
                "SpamBlacklistHooks": "SpamBlacklistHooks.php",
                "SpamBlacklist": "SpamBlacklist_body.php",
+               "SpamBlacklistLogFormatter": "SpamBlacklistLogFormatter.php",
                "SpamRegexBatch": "SpamRegexBatch.php",
                "SpamBlacklistPreAuthenticationProvider": 
"SpamBlacklistPreAuthenticationProvider.php"
        },

-- 
To view, visit https://gerrit.wikimedia.org/r/333484
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia223a89e12c652a87d52a18c78e612b4b12871bc
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SpamBlacklist
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to