* Pass page title as parameters to "linkshere" and "nolinkshere" and update
default message text
* Allows to upload from publicy accessible URL. Set $wgAllowCopyUploads = true ; in LocalSettings.php
+ Limited to $wgMaxUploadSize (default:100MB)
== Languages updated ==
$wgCacheSharedUploads = true;
/** Allow for upload to be copied from an URL. Requires Special:Upload?source=web */
$wgAllowCopyUploads = false;
+/** Max size for uploads, in bytes */
+$wgMaxUploadSize = 1024*1024*100; # 100MB
/**
* Point the upload navigation link to an external URL
* @access private
*/
function initialize_web_file( &$request ) {
- global $wgTmpDirectory;
+ global $wgTmpDirectory, $wgMaxUploadSize;
$url = $request->getText( 'wpUploadFile' );
$local_file = tempnam( $wgTmpDirectory, 'WEBUPLOAD' );
- # Maybe check for filesize($url) first?
- $error = !@copy( $url, $local_file );
+ if ( $wgMaxUploadSize < @filesize ( $url ) ) $error = true ;
+ else $error = !@copy( $url, $local_file );
$this->mUploadTempName = $local_file;
$this->mUploadSize = filesize( $local_file );