r44832 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44831‎ | r44832 | r44833 >
Date:08:13, 20 December 2008
Author:tstarling
Status:deferred
Tags:
Comment:
Fixes as per bug 15895 comment 7.
Modified paths:
  • /trunk/phase3/includes/IEContentAnalyzer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/IEContentAnalyzer.php
@@ -569,8 +569,9 @@
570570 $chunk3 = substr( $chunk, 0, 3 );
571571 $chunk4 = substr( $chunk, 0, 4 );
572572 $chunk5 = substr( $chunk, 0, 5 );
 573+ $chunk5uc = strtoupper( $chunk5 );
573574 $chunk8 = substr( $chunk, 0, 8 );
574 - if ( $chunk5 == 'GIF87' || $chunk5 == 'GIF89' ) {
 575+ if ( $chunk5uc == 'GIF87' || $chunk5uc == 'GIF89' ) {
575576 return 'image/gif';
576577 }
577578 if ( $chunk2 == "\xff\xd8" ) {
@@ -579,7 +580,7 @@
580581
581582 if ( $chunk2 == 'BM'
582583 && substr( $chunk, 6, 2 ) == "\000\000"
583 - && substr( $chunk, 8, 2 ) != "\000\000" )
 584+ && substr( $chunk, 8, 2 ) == "\000\000" )
584585 {
585586 return 'image/bmp'; // another non-standard MIME
586587 }
@@ -800,7 +801,7 @@
801802 }
802803
803804 // BinHex
804 - if ( !strncasecmp( $remainder, $binhexMagic, strlen( $binhexMagic ) ) ) {
 805+ if ( !strncmp( $remainder, $binhexMagic, strlen( $binhexMagic ) ) ) {
805806 $found['binhex'] = true;
806807 }
807808 }

Status & tagging log