Allow external URLs (e.g. http://bits.wikimedia.org/foo) in OutputPage::addScript()
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 2 Feb 2010 00:44:32 +0000 (00:44 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 2 Feb 2010 00:44:32 +0000 (00:44 +0000)
includes/OutputPage.php

index f883a2d..a378905 100644 (file)
@@ -186,7 +186,7 @@ class OutputPage {
         */
        public function addScriptFile( $file ) {
                global $wgStylePath, $wgStyleVersion;
-               if( substr( $file, 0, 1 ) == '/' ) {
+               if( substr( $file, 0, 1 ) == '/' || substr( $file, 0, 7 ) == 'http://' ) {
                        $path = $file;
                } else {
                        $path =  "{$wgStylePath}/common/{$file}";