|
From: <be...@us...> - 2014-04-25 05:09:34
|
Revision: 12472
http://sourceforge.net/p/xoops/svn/12472
Author: beckmi
Date: 2014-04-25 05:09:29 +0000 (Fri, 25 Apr 2014)
Log Message:
-----------
Adding uploader.php improvement from Zyspec
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/uploader.php
Modified: XoopsCore/branches/2.5.x/2.5.7/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/docs/changelog.250.txt 2014-04-24 18:26:01 UTC (rev 12471)
+++ XoopsCore/branches/2.5.x/2.5.7/docs/changelog.250.txt 2014-04-25 05:09:29 UTC (rev 12472)
@@ -3,7 +3,7 @@
===============================
2014/xx/xx: Version 2.5.7 Final
===============================
-- updated XoopsMediaUploader to use system memory values from php.ini, and to offer random file names (mamba/luciorota)
+- updated XoopsMediaUploader to use system memory values from php.ini, and to offer random file names (mamba/luciorota/zyspec)
===============================
2014/04/06: Version 2.5.7 RC 1
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/uploader.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/uploader.php 2014-04-24 18:26:01 UTC (rev 12471)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/uploader.php 2014-04-25 05:09:29 UTC (rev 12472)
@@ -127,19 +127,17 @@
}
$this->uploadDir = $uploadDir;
- if (isset($maxFileSize) && $maxFileSize > 0) {
+ $maxUploadInBytes = $this->return_bytes(ini_get('upload_max_filesize'));
+ $maxPostInBytes = $this->return_bytes(ini_get('post_max_size'));
+ $memoryLimitInBytes = $this->return_bytes(ini_get('memory_limit'));
+ if (intval($maxFileSize) > 0) {
$maxFileSizeInBytes = $this->return_bytes($maxFileSize);
- $maxUploadInBytes = $this->return_bytes(ini_get('upload_max_filesize'));
- $maxPostInBytes = $this->return_bytes(ini_get('post_max_size'));
- $memoryLimitInBytes = $this->return_bytes(ini_get('memory_limit'));
- $newMaxFileSize = min($maxFileSizeInBytes, $maxUploadInBytes, $maxPostInBytes, $memoryLimitInBytes);
- $this->maxFileSize = $newMaxFileSize;
+ $newMaxFileSize = min($maxFileSizeInBytes, $maxUploadInBytes, $maxPostInBytes, $memoryLimitInBytes);
} else {
- $this->maxFileSize = $maxFileSize;
+ $newMaxFileSize = min($maxUploadInBytes, $maxPostInBytes, $memoryLimitInBytes);
}
+ $this->maxFileSize = $newMaxFileSize;
-
-
if (isset($maxWidth)) {
$this->maxWidth = intval($maxWidth);
}
|