From fed37fcc829903c57319dbaa34fe33609c022448 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Fri, 31 Mar 2023 00:18:28 -0500 Subject: [PATCH] preloadparams on other platforms supports numbered indexes Change-Id: I4f1f5e8758007ab95e342ad5429c909f495d8deb --- extension.json | 1 + modules/ReplyLinksController.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extension.json b/extension.json index 1ad7ed0f5..7a9d9d481 100644 --- a/extension.json +++ b/extension.json @@ -97,6 +97,7 @@ "oojs-ui-windows", "mediawiki.api", "mediawiki.Title", + "mediawiki.Uri", "mediawiki.util", "mediawiki.storage", "mediawiki.String", diff --git a/modules/ReplyLinksController.js b/modules/ReplyLinksController.js index ad383832e..60f6de5f2 100644 --- a/modules/ReplyLinksController.js +++ b/modules/ReplyLinksController.js @@ -174,7 +174,8 @@ ReplyLinksController.prototype.parseNewTopicLink = function ( href ) { data.preload = url.searchParams.get( 'preload' ); } if ( url.searchParams.getAll( 'preloadparams[]' ).length ) { - data.preloadparams = url.searchParams.getAll( 'preloadparams[]' ); + // Handle numbered array parameters like MediaWiki's PHP code does (T231382) + data.preloadparams = new mw.Uri( url.toString(), { arrayParams: true } ).query.preloadparams; } if ( url.searchParams.get( 'preloadtitle' ) ) { data.preloadtitle = url.searchParams.get( 'preloadtitle' );