r41969 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41968‎ | r41969 | r41970 >
Date:14:14, 11 October 2008
Author:tstarling
Status:old
Tags:
Comment:
Revert r41628:
* register_globals XSS vulnerability
* references playerStats.js which has plenty of issues of its own
* please fix your whitespace issues
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler.php (modified) (history)
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler.php
@@ -25,8 +25,8 @@
2626 $wgExtensionCredits['media'][] = array(
2727 'name' => 'OggHandler',
2828 'author' => 'Tim Starling',
29 - 'svn-date' => '$LastChangedDate$',
30 - 'svn-revision' => '$LastChangedRevision$',
 29+ 'svn-date' => '$LastChangedDate$',
 30+ 'svn-revision' => '$LastChangedRevision$',
3131 'url' => 'http://www.mediawiki.org/wiki/Extension:OggHandler',
3232 'description' => 'Handler for Ogg Theora and Vorbis files, with JavaScript player.',
3333 'descriptionmsg' => 'ogg-desc',
@@ -34,11 +34,6 @@
3535
3636 /******************* CONFIGURATION STARTS HERE **********************/
3737
38 -
39 -//the absolute or relative path of the playerStatsCollector.js file
40 -$wgStatsCollection=false;
41 -//$wgPlayerStatsCollectionJs = $wgScriptPath . '/extensions/PlayerStatsGrabber/playerStats.js';
42 -
4338 // Location of the FFmpeg binary
4439 $wgFFmpegLocation = 'ffmpeg';
4540
Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -390,7 +390,7 @@
391391 }
392392
393393 function setHeaders( $out ) {
394 - global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer, $wgUser, $wgProxyKey, $wgPlayerStatsCollectionJs;
 394+ global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer;
395395 if ( $out->hasHeadItem( 'OggHandler' ) ) {
396396 return;
397397 }
@@ -403,9 +403,7 @@
404404 'ogg-player-totem', 'ogg-player-kaffeine', 'ogg-player-kmplayer', 'ogg-player-mplayerplug-in',
405405 'ogg-player-thumbnail', 'ogg-player-selected', 'ogg-use-player', 'ogg-more', 'ogg-download',
406406 'ogg-desc-link', 'ogg-dismiss', 'ogg-player-soundthumb', 'ogg-no-xiphqt' );
407 - $msgValues = array_map( 'wfMsg', $msgNames );
408 -
409 -
 407+ $msgValues = array_map( 'wfMsg', $msgNames );
410408 $jsMsgs = Xml::encodeJsVar( (object)array_combine( $msgNames, $msgValues ) );
411409 $cortadoUrl = $wgCortadoJarFile;
412410 $scriptPath = self::getMyScriptPath();
@@ -415,7 +413,7 @@
416414 }
417415 $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl );
418416 $encExtPathUrl = Xml::encodeJsVar( $scriptPath );
419 -
 417+
420418 $out->addHeadItem( 'OggHandler', <<<EOT
421419 <script type="text/javascript" src="$scriptPath/OggPlayer.js?$wgOggScriptVersion"></script>
422420 <script type="text/javascript">
@@ -432,19 +430,8 @@
433431 }
434432 </style>
435433 EOT
436 - );
437 - //if collecting stats add relevant code:
438 - if($wgPlayerStatsCollectionJs){
439 - $jsUserHash = sha1( $wgUser->getName() . $wgProxyKey);
440 - $enUserHash = Xml::encodeJsVar( $jsUserHash );
441 - $out->addHeadItem('playerStatsCollection', <<<EOT
442 -<script type="text/javascript" src="$wgPlayerStatsCollectionJs"></script>
443 -<script type="text/javascript">
444 -wgOggPlayer.userHash = $enUserHash;
445 -</script>
446 -EOT
447 -);
448 - }
 434+ );
 435+
449436 }
450437
451438 function parserTransformHook( $parser, $file ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r42184fixed issues of r41969 revert. Removed XSS, ( less variable overloading ), fa...dale23:53, 17 October 2008
r42237Reverting r42184 "fixed issues of r41969 revert. Removed XSS, ( less variable...brion00:11, 20 October 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41628updates for player Stats Collection (currently disabled)dale00:30, 4 October 2008

Status & tagging log