$details = null;
$value = null;
$value = $this->internalProcessUpload( $details );
-
+
switch($value) {
case self::SUCCESS:
$wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() );
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.
*/
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;
* @access private
*/
function mainUploadForm( $msg='' ) {
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgLang, $wgMaxUploadSize;
global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
global $wgRequest, $wgAllowCopyUploads;
global $wgStylePath, $wgStyleVersion;
}
}
+ # 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 = strtoupper( ( substr( $val, -1 ) ) );
+ switch( $last ) {
+ case 'G':
+ $val2 = substr( $val, 0, -1 ) * 1024 * 1024 * 1024;
+ break;
+ case 'M':
+ $val2 = substr( $val, 0, -1 ) * 1024 * 1024;
+ break;
+ case 'K':
+ $val2 = substr( $val, 0, -1 ) * 1024;
+ break;
+ default:
+ $val2 = $val;
+ }
+ $val2 = $wgAllowCopyUploads ? min( $wgMaxUploadSize, $val2 ) : $val2;
+ $maxUploadSize = wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), $wgLang->formatSize( $val2 ) );
+
$sourcefilename = wfMsgExt( 'sourcefilename', 'escapenoentities' );
$destfilename = wfMsgExt( 'destfilename', 'escapenoentities' );
$summary = wfMsgExt( 'fileuploadsummary', 'parseinline' );
<tr>
<td></td>
<td>
+ {$maxUploadSize}
{$extensionsList}
</td>
</tr>
* @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>' );
}
}