From: Andrew Garrett Date: Mon, 25 Feb 2008 10:10:42 +0000 (+0000) Subject: (bug 13143) Fix regression in r25481, in which file extensions were incorrectly being... X-Git-Tag: 1.31.0-rc.0~49373 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=6b4990498b6c5b5ab2f86f53e3c2fa23a48c2b46;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 2f463f9c24..1227b93106 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -580,8 +580,11 @@ class UploadForm { $partname = $file->getName(); $rawExtension = ''; } else { - list( $partname, $rawExtension ) = explode( '.', $file->getName(), 2 ); + $n = strrpos( $file->getName(), '.' ); + $rawExtension = substr( $file->getName(), $n + 1 ); + $partname = substr( $file->getName(), 0, $n ); } + $sk = $wgUser->getSkin(); if ( $rawExtension != $file->getExtension() ) {