Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -1137,7 +1137,7 @@ |
1138 | 1138 | * "text/javascript"; if no type is provided, text/javascript is assumed. |
1139 | 1139 | */ |
1140 | 1140 | load: function ( modules, type ) { |
1141 | | - var filtered, m; |
| 1141 | + var filtered, m, reValidURL; |
1142 | 1142 | |
1143 | 1143 | // Validate input |
1144 | 1144 | if ( typeof modules !== 'object' && typeof modules !== 'string' ) { |
— | — | @@ -1146,7 +1146,8 @@ |
1147 | 1147 | // Allow calling with an external url or single dependency as a string |
1148 | 1148 | if ( typeof modules === 'string' ) { |
1149 | 1149 | // Support adding arbitrary external scripts |
1150 | | - if ( /^(https?:)?\/\//.test( modules ) ) { |
| 1150 | + reValidURL = new RegExp( '^((https?:)?\\/\\/|' + $.escapeRE( mw.config.get( 'wgScript' ) ) + ')' ); |
| 1151 | + if ( reValidURL.test( modules ) ) { |
1151 | 1152 | if ( type === 'text/css' ) { |
1152 | 1153 | $( 'head' ).append( $( '<link>', { |
1153 | 1154 | rel: 'stylesheet', |