Merge "Fix exceptions on weirdly encoded URLs"

This commit is contained in:
jenkins-bot 2024-02-05 22:22:02 +00:00 committed by Gerrit Code Review
commit 6816c15a03

View file

@ -592,14 +592,14 @@ function init( $container, state ) {
return !pattern.test( fragment );
} ) ) {
findCommentQuery = {
heading: decodeURI( fragment ).replace( / /g, '_' ),
heading: mw.util.percentDecodeFragment( fragment ).replace( / /g, '_' ),
page: mw.config.get( 'wgRelevantPageName' )
};
isHeading = true;
}
} else if ( highlightResult.highlighted.length === 0 && highlightResult.requested.length === 1 ) {
findCommentQuery = {
idorname: decodeURI( highlightResult.requested[ 0 ] )
idorname: mw.util.percentDecodeFragment( highlightResult.requested[ 0 ] )
};
isHeading = highlightResult.requested[ 0 ].slice( 0, 1 ) === 'h';
}