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

Revision: 97289
Author:   reedy
Date:     2011-09-16 15:17:57 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
1.17wmf1 Revert r96400, MFT r96560

Modified Paths:
--------------
    branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php
    branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js

Modified: branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php
===================================================================
--- branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php     
2011-09-16 15:12:40 UTC (rev 97288)
+++ branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php     
2011-09-16 15:17:57 UTC (rev 97289)
@@ -418,12 +418,12 @@
        }
 
        static function getMyScriptPath() {
-               global $wgScriptPath;
-               return "$wgScriptPath/extensions/OggHandler";
+               global $wgExtensionAssetsPath;
+               return "$wgExtensionAssetsPath/OggHandler";
        }
 
        function setHeaders( $out ) {
-               global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer;
+               global $wgOggScriptVersion, $wgCortadoJarFile;
 
                if ( $out->hasHeadItem( 'OggHandlerScript' ) && 
$out->hasHeadItem( 'OggHandlerInlineScript' ) &&
                        $out->hasHeadItem( 'OggHandlerInlineCSS' ) ) {
@@ -441,8 +441,9 @@
                $cortadoUrl = $wgCortadoJarFile;
                $scriptPath = self::getMyScriptPath();
                if( substr( $cortadoUrl, 0, 1 ) != '/'
-                       && substr( $cortadoUrl, 0, 4 ) != 'http' ) {
-                       $cortadoUrl = "$wgServer$scriptPath/$cortadoUrl";
+                               && substr( $cortadoUrl, 0, 4 ) != 'http' )
+               {
+                       $cortadoUrl = wfExpandUrl( "$scriptPath/$cortadoUrl", 
PROTO_CURRENT );
                }
                $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl );
                $encExtPathUrl = Xml::encodeJsVar( $scriptPath );
@@ -514,11 +515,7 @@
 
                OggTransformOutput::$serial++;
 
-               if ( substr( $this->videoUrl, 0, 4 ) != 'http' ) {
-                       $url = wfExpandUrl( $this->videoUrl, PROTO_CURRENT );
-               } else {
-                       $url = $this->videoUrl;
-               }
+               $url = wfExpandUrl( $this->videoUrl, PROTO_RELATIVE );
                // Normalize values
                $length = floatval( $this->length );
                $width = intval( $this->width );

Modified: branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js
===================================================================
--- branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js    2011-09-16 
15:12:40 UTC (rev 97288)
+++ branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js    2011-09-16 
15:17:57 UTC (rev 97289)
@@ -51,6 +51,11 @@
         * Parameters are: id, videoUrl, width, height, length, linkUrl, isVideo
         */
        'init': function ( player, params ) {
+               // Expand params.videoUrl if protocol-relative
+               if ( params.videoUrl.substr( 0, 2 ) == '//' ) {
+                       // window.location.protocol is something like 'http:'
+                       params.videoUrl = window.location.protocol + 
params.videoUrl;
+               }
                elt = document.getElementById( params.id );
 
                // Save still image HTML


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

Reply via email to