Fix Classe FileUploader

This commit is contained in:
rMontagne
2011-09-13 08:25:52 +00:00
parent 6b3bcd668b
commit aaa3c46161
+1 -14
View File
@@ -127,9 +127,7 @@ class FileUploaderCore
$allowedExtensions = array_map("strtolower", $allowedExtensions);
$this->allowedExtensions = $allowedExtensions;
$this->sizeLimit = $sizeLimit;
$this->checkServerSettings();
$this->sizeLimit = $sizeLimit;
if (isset($_GET['qqfile']))
$this->file = new qqUploadedFileXhr();
@@ -137,17 +135,6 @@ class FileUploaderCore
$this->file = false;
}
private function checkServerSettings()
{
$postSize = $this->toBytes(ini_get('post_max_size'));
$uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit)
{
$size = max(1, $this->sizeLimit / 1024 / 1024) . 'M';
die("{'error':".Tools::displayError('increase post_max_size and upload_max_filesize to $size')."}");
}
}
private function toBytes($str)
{