(bug 13603) Added siprop=usergroups to meta=siteinfo. Patch by Mormegil
[lhc/web/wiklou.git] / includes / SpecialUpload.php
index 24e1083..8ea9a8e 100644 (file)
@@ -280,7 +280,7 @@ class UploadForm {
                $details = null;
                $value = null;
                $value = $this->internalProcessUpload( $details );
-               
+
                switch($value) {
                        case self::SUCCESS:
                                $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() );
@@ -376,11 +376,6 @@ class UploadForm {
                        return self::BEFORE_PROCESSING;
                }
 
-               /* Check for curl error */
-               if( $this->mCurlError ) {
-                       return self::BEFORE_PROCESSING;
-               }
-
                /**
                 * If there was no filename or a zero size given, give up quick.
                 */
@@ -388,6 +383,11 @@ class UploadForm {
                        return self::EMPTY_FILE;
                }
 
+               /* Check for curl error */
+               if( $this->mCurlError ) {
+                       return self::BEFORE_PROCESSING;
+               }
+
                # Chop off any directories in the given filename
                if( $this->mDesiredDestName ) {
                        $basename = $this->mDesiredDestName;
@@ -983,7 +983,7 @@ wgUploadAutoFill = {$autofill};
                # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only
                # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize
                $val = trim( ini_get( 'upload_max_filesize' ) );
-               $last = ( substr( $val, -1 ) );
+               $last = strtoupper( ( substr( $val, -1 ) ) );
                switch( $last ) {
                        case 'G':
                                $val2 = substr( $val, 0, -1 ) * 1024 * 1024 * 1024;
@@ -998,7 +998,7 @@ wgUploadAutoFill = {$autofill};
                                $val2 = $val;
                }
                $val2 = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val2 ) : $val2;
-               $maxUploadSize = wfMsgExt( 'upload-maxfilesize', 'parseinline', $wgLang->formatSize( $val2 ) );
+               $maxUploadSize = wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), $wgLang->formatSize( $val2 ) );
 
                $sourcefilename = wfMsgExt( 'sourcefilename', 'escapenoentities' );
                $destfilename = wfMsgExt( 'destfilename', 'escapenoentities' );
@@ -1662,19 +1662,17 @@ wgUploadAutoFill = {$autofill};
         * @param string filename
         */
        private function showDeletionLog( $out, $filename ) {
-               $reader = new LogReader(
-                       new FauxRequest(
-                               array(
-                                       'page' => $filename,
-                                       'type' => 'delete',
-                                       )
-                       )
-               );
-               if( $reader->hasRows() ) {
+               global $wgUser;
+               $loglist = new LogEventsList( $wgUser->getSkin() );
+               $pager = new LogPager( $loglist, 'delete', false, $filename );
+               if( $pager->getNumRows() > 0 ) {
                        $out->addHtml( '<div id="mw-upload-deleted-warn">' );
                        $out->addWikiMsg( 'upload-wasdeleted' );
-                       $viewer = new LogViewer( $reader );
-                       $viewer->showList( $out );
+                       $out->addHTML(
+                               $loglist->beginLogEventsList() .
+                               $pager->getBody() .
+                               $loglist->endLogEventsList()
+                       );
                        $out->addHtml( '</div>' );
                }
        }