// preference admin controller updated and tools convertbyte too
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11623 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+1
-1
@@ -1916,7 +1916,7 @@ FileETag INode MTime Size
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$value_length = strlen($value);
|
$value_length = strlen($value);
|
||||||
$qty = substr($value, 0, $value_length - 1 );
|
$qty = (int)substr($value, 0, $value_length - 1 );
|
||||||
$unit = strtolower(substr($value, $value_length - 1));
|
$unit = strtolower(substr($value, $value_length - 1));
|
||||||
switch ($unit)
|
switch ($unit)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -385,14 +385,15 @@ class AdminPreferencesControllerCore extends AdminController
|
|||||||
/**
|
/**
|
||||||
* Update PS_ATTACHMENT_MAXIMUM_SIZE
|
* Update PS_ATTACHMENT_MAXIMUM_SIZE
|
||||||
*/
|
*/
|
||||||
public function updateOptionPsAttachementMaximumSize($value)
|
public function updateOptionPsAttachmentMaximumSize($value)
|
||||||
{
|
{
|
||||||
if (!$value)
|
if (!$value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$upload_max_size = (int)str_replace('M', '', ini_get('upload_max_filesize'));
|
$upload_max_size = Tools::convertBytes(ini_get('upload_max_filesize'));
|
||||||
$post_max_size = (int)str_replace('M', '', ini_get('post_max_size'));
|
$post_max_size = Tools::convertBytes(ini_get('post_max_size'));
|
||||||
$max_size = $upload_max_size < $post_max_size ? $upload_max_size : $post_max_size;
|
$max_size = ($upload_max_size < $post_max_size ? $upload_max_size : $post_max_size) / 1048576;
|
||||||
|
// at this point, all values are in megaBytes
|
||||||
$value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
|
$value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
|
||||||
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', $value);
|
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', $value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user