http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100699

Revision: 100699
Author:   catrope
Date:     2011-10-25 14:30:33 +0000 (Tue, 25 Oct 2011)
Log Message:
-----------
(bug 31499) articlePathRegex (detection of external links within the same wiki) 
broken when wgServer is protocol-relative

Modified Paths:
--------------
    trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js

Modified: 
trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js
===================================================================
--- trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js     
2011-10-25 14:30:20 UTC (rev 100698)
+++ trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js     
2011-10-25 14:30:33 UTC (rev 100699)
@@ -502,9 +502,11 @@
                                        }
                                },
                                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


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to