r31246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31245‎ | r31246 | r31247 >
Date:10:10, 25 February 2008
Author:werdna
Status:old
Tags:
Comment:
(bug 13143) Fix regression in r25481, in which file extensions were incorrectly being determined by taking the part of the filename after the first period. Behaviour modified to take the part after the LAST period.
Modified paths:
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUpload.php
@@ -580,8 +580,11 @@
581581 $partname = $file->getName();
582582 $rawExtension = '';
583583 } else {
584 - list( $partname, $rawExtension ) = explode( '.', $file->getName(), 2 );
 584+ $n = strrpos( $file->getName(), '.' );
 585+ $rawExtension = substr( $file->getName(), $n + 1 );
 586+ $partname = substr( $file->getName(), 0, $n );
585587 }
 588+
586589 $sk = $wgUser->getSkin();
587590
588591 if ( $rawExtension != $file->getExtension() ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r25481Fix the fix in r25439, which incorrectly assumed that normalized extensions a...brion15:56, 4 September 2007

Status & tagging log