* Url decode target param
* Pass through mw.Title to convert underscores to spaces
Bug: T182164
Change-Id: Iabb0d8ea2b9f93f943e8493ee0a29d3bee3b3682
- parts = uri.path.match( re );
+ parts = mw.Uri.decode( uri.path ).match( re );
if ( parts ) {
uri.path = parts[ 1 ];
uri.query.target = parts[ 2 ];
if ( parts ) {
uri.path = parts[ 1 ];
uri.query.target = parts[ 2 ];
* Respond to the model being updated
*/
mw.rcfilters.ui.RclTargetPageWidget.prototype.updateUiBasedOnModel = function () {
* Respond to the model being updated
*/
mw.rcfilters.ui.RclTargetPageWidget.prototype.updateUiBasedOnModel = function () {
- this.titleSearch.setValue( this.model.getValue() );
+ var title = mw.Title.newFromText( this.model.getValue() );
+ this.titleSearch.setValue( title ? title.toText() : this.model.getValue() );
output: 'http://host/wiki/Special:RecentChangesLinked?target=Moai',
message: 'Target as subpage in path'
},
output: 'http://host/wiki/Special:RecentChangesLinked?target=Moai',
message: 'Target as subpage in path'
},
+ {
+ input: 'http://host/wiki/Special:RecentChangesLinked/Château',
+ output: 'http://host/wiki/Special:RecentChangesLinked?target=Château',
+ message: 'Target as subpage in path with special characters'
+ },
{
input: 'http://host/wiki/Special:RecentChangesLinked/Moai/Sub1',
output: 'http://host/wiki/Special:RecentChangesLinked?target=Moai/Sub1',
{
input: 'http://host/wiki/Special:RecentChangesLinked/Moai/Sub1',
output: 'http://host/wiki/Special:RecentChangesLinked?target=Moai/Sub1',