From 6b4990498b6c5b5ab2f86f53e3c2fa23a48c2b46 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 25 Feb 2008 10:10:42 +0000 Subject: [PATCH] (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. --- includes/SpecialUpload.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() ) { -- 2.20.1