Page MenuHomePhabricator

0004-SECURITY-URL-parsing-for-log-switching.patch

Authored By
Ejegg
Mar 8 2018, 10:50 PM
Size
1 KB
Referenced Files
None
Subscribers
None

0004-SECURITY-URL-parsing-for-log-switching.patch

From 0d3e9b6293fa02e2db2c0d753b6597bb0b2a7f6a Mon Sep 17 00:00:00 2001
From: Andrew Green <andrew.green.df@gmail.com>
Date: Mon, 5 Mar 2018 10:22:02 -0600
Subject: [PATCH 4/4] SECURITY: URL parsing for log switching
This issue is not exploitable, but should make the
code more robust against future changes.
Change-Id: I3cdc3d582e224dee0311b991544892f4a5ad47fb
Co-authored-by: Brian Wolff <bawolff+wn@gmail.com>
Bug: T171987
---
extension.json | 3 ++-
resources/infrastructure/centralnotice.js | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/extension.json b/extension.json
index 91564e4..3a7da9c 100644
--- a/extension.json
+++ b/extension.json
@@ -116,7 +116,8 @@
"ext.centralNotice.adminUi": {
"dependencies": [
"jquery.ui.datepicker",
- "jquery.ui.multiselect"
+ "jquery.ui.multiselect",
+ "mediawiki.Uri"
],
"scripts": "infrastructure/centralnotice.js",
"styles": [
diff --git a/resources/infrastructure/centralnotice.js b/resources/infrastructure/centralnotice.js
index 9ff7d6a..b41f7e0 100644
--- a/resources/infrastructure/centralnotice.js
+++ b/resources/infrastructure/centralnotice.js
@@ -43,8 +43,9 @@
// Switch among various log displays
window.switchLogs = function ( baseUrl, logType ) {
+ var url = new mw.Uri( baseUrl );
encodeURIComponent( logType );
- location.href = baseUrl + '?log=' + logType;
+ location.href = url.extend( { log: logType } ).toString();
};
// FIXME Unused? See T161907
--
2.16.1

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5608326
Default Alt Text
0004-SECURITY-URL-parsing-for-log-switching.patch (1 KB)

Event Timeline