* regression fix: make dumpUploads.php work again
[lhc/web/wiklou.git] / includes / SpecialUpload.php
index 2f463f9..0583c1d 100644 (file)
@@ -141,7 +141,8 @@ class UploadForm {
                $this->mTempPath       = $local_file;
                $this->mFileSize       = 0; # Will be set by curlCopy
                $this->mCurlError      = $this->curlCopy( $url, $local_file );
-               $this->mSrcName        = array_pop( explode( '/', $url ) );
+               $pathParts             = explode( '/', $url );
+               $this->mSrcName        = array_pop( $pathParts );
                $this->mSessionKey     = false;
                $this->mStashed        = false;
 
@@ -580,8 +581,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() ) {
@@ -609,7 +613,7 @@ class UploadForm {
                                $dlink2 = '';
                        }
 
-                       $warning .= '<li>' . wfMsgExt( 'fileexists', 'parseinline', $dlink ) . '</li>' . $dlink2;
+                       $warning .= '<li>' . wfMsgExt( 'fileexists', array('parseinline','replaceafter'), $dlink ) . '</li>' . $dlink2;
 
                } elseif( $file->getTitle()->getArticleID() ) {
                        $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' );