mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-15 03:35:58 +00:00
(bug 31499) articlePathRegex (detection of external links within the same wiki) broken when wgServer is protocol-relative
This commit is contained in:
parent
11aabbd4a9
commit
280ae464a4
Notes:
Roan Kattouw
2011-10-25 14:30:33 +00:00
|
@ -502,9 +502,11 @@ getDefaultConfig: function () {
|
|||
}
|
||||
},
|
||||
open: function() {
|
||||
// Obtain the server name without the protocol. wgServer may be protocol-relative
|
||||
var serverName = mw.config.get( 'wgServer' ).replace( /^(https?:)?\/\//, '' );
|
||||
// Cache the articlepath regex
|
||||
$(this).data( 'articlePathRegex', new RegExp(
|
||||
'^' + $.escapeRE( mw.config.get( 'wgServer' ) + mw.config.get( 'wgArticlePath' ) )
|
||||
'^https?://' + $.escapeRE( serverName + mw.config.get( 'wgArticlePath' ) )
|
||||
.replace( /\\\$1/g, '(.*)' ) + '$'
|
||||
) );
|
||||
// Pre-fill the text fields based on the current selection
|
||||
|
|
Loading…
Reference in a new issue