r97289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97288‎ | r97289 | r97290 >
Date:15:17, 16 September 2011
Author:reedy
Status:ok
Tags:
Comment:
1.17wmf1 Revert r96400, MFT r96560
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/OggHandler/OggPlayer.js
@@ -51,6 +51,11 @@
5252 * Parameters are: id, videoUrl, width, height, length, linkUrl, isVideo
5353 */
5454 'init': function ( player, params ) {
 55+ // Expand params.videoUrl if protocol-relative
 56+ if ( params.videoUrl.substr( 0, 2 ) == '//' ) {
 57+ // window.location.protocol is something like 'http:'
 58+ params.videoUrl = window.location.protocol + params.videoUrl;
 59+ }
5560 elt = document.getElementById( params.id );
5661
5762 // Save still image HTML
Index: branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php
@@ -418,12 +418,12 @@
419419 }
420420
421421 static function getMyScriptPath() {
422 - global $wgScriptPath;
423 - return "$wgScriptPath/extensions/OggHandler";
 422+ global $wgExtensionAssetsPath;
 423+ return "$wgExtensionAssetsPath/OggHandler";
424424 }
425425
426426 function setHeaders( $out ) {
427 - global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer;
 427+ global $wgOggScriptVersion, $wgCortadoJarFile;
428428
429429 if ( $out->hasHeadItem( 'OggHandlerScript' ) && $out->hasHeadItem( 'OggHandlerInlineScript' ) &&
430430 $out->hasHeadItem( 'OggHandlerInlineCSS' ) ) {
@@ -441,8 +441,9 @@
442442 $cortadoUrl = $wgCortadoJarFile;
443443 $scriptPath = self::getMyScriptPath();
444444 if( substr( $cortadoUrl, 0, 1 ) != '/'
445 - && substr( $cortadoUrl, 0, 4 ) != 'http' ) {
446 - $cortadoUrl = "$wgServer$scriptPath/$cortadoUrl";
 445+ && substr( $cortadoUrl, 0, 4 ) != 'http' )
 446+ {
 447+ $cortadoUrl = wfExpandUrl( "$scriptPath/$cortadoUrl", PROTO_CURRENT );
447448 }
448449 $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl );
449450 $encExtPathUrl = Xml::encodeJsVar( $scriptPath );
@@ -514,11 +515,7 @@
515516
516517 OggTransformOutput::$serial++;
517518
518 - if ( substr( $this->videoUrl, 0, 4 ) != 'http' ) {
519 - $url = wfExpandUrl( $this->videoUrl, PROTO_CURRENT );
520 - } else {
521 - $url = $this->videoUrl;
522 - }
 519+ $url = wfExpandUrl( $this->videoUrl, PROTO_RELATIVE );
523520 // Normalize values
524521 $length = floatval( $this->length );
525522 $width = intval( $this->width );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96400Fix for total extension breakage due to protocol relative URLststarling02:57, 7 September 2011
r96560OggHandler: Address issues with protocol-relative URLs. Live hack in r96400....catrope12:59, 8 September 2011

Status & tagging log