preloadparams on other platforms supports numbered indexes

Change-Id: I4f1f5e8758007ab95e342ad5429c909f495d8deb
This commit is contained in:
David Lynch 2023-03-31 00:18:28 -05:00 committed by Bartosz Dziewoński
parent e6282e9dd8
commit fed37fcc82
2 changed files with 3 additions and 1 deletions

View file

@ -97,6 +97,7 @@
"oojs-ui-windows",
"mediawiki.api",
"mediawiki.Title",
"mediawiki.Uri",
"mediawiki.util",
"mediawiki.storage",
"mediawiki.String",

View file

@ -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' );