Page MenuHomePhorge

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/resources/src/mediawiki.special.block/stores/block.js b/resources/src/mediawiki.special.block/stores/block.js
index 6967eaba898..195748dc1af 100644
--- a/resources/src/mediawiki.special.block/stores/block.js
+++ b/resources/src/mediawiki.special.block/stores/block.js
@@ -284,6 +284,8 @@ module.exports = exports = defineStore( 'block', () => {
} else {
params.delete( 'remove' );
}
+ // Remove title= if present
+ params.delete( 'title' );
// Trim off the trailing slash and any target user from the page name.
const pageName = mw.config.get( 'wgPageName' ).replace( /\/(?:[^/]+)?$/, '' );
const newUrl = mw.util.getUrl( pageName + ( targetUser.value ? '/' + targetUser.value : '' ) );
@@ -555,8 +557,8 @@ module.exports = exports = defineStore( 'block', () => {
* of these modules
*
* @param {string} target is expected to be sanitized
- * @param blocks
- * @return {bool} true if target is the intended target of the block
+ * @param {Object[]} blocks
+ * @return {boolean} true if target is the intended target of the block
*/
function isTargetAlreadyBlocked( target, blocks ) {
// T392049
diff --git a/tests/jest/mediawiki.special.block/stores/block.test.js b/tests/jest/mediawiki.special.block/stores/block.test.js
index 226b1a66684..c8f4c690df0 100644
--- a/tests/jest/mediawiki.special.block/stores/block.test.js
+++ b/tests/jest/mediawiki.special.block/stores/block.test.js
@@ -99,12 +99,14 @@ describe( 'Block store', () => {
store.targetUser = 'ExampleUser';
await nextTick();
expect( location.pathname ).toStrictEqual( '/wiki/Special:Block/ExampleUser' );
+ // Add some extra params to the URL. This also tests that 'title=' is removed.
+ history.replaceState( {}, '', '/wiki/Special:Block/ExampleUser?title=Special:Block&foo=bar' );
store.blockId = 1234;
await nextTick();
- expect( location.search ).toStrictEqual( '?id=1234' );
+ expect( location.search ).toStrictEqual( '?foo=bar&id=1234' );
store.removalConfirmationOpen = true;
await nextTick();
- expect( location.search ).toStrictEqual( '?id=1234&remove=1' );
+ expect( location.search ).toStrictEqual( '?foo=bar&id=1234&remove=1' );
} );
} );

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (8 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227443
Default Alt Text
(2 KB)

Event Timeline