[*] BO : Removed size limit for image upload (BL006, CC136)
This commit is contained in:
@@ -117,9 +117,6 @@ abstract class AdminSelfTab
|
||||
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
||||
protected $_orderWay;
|
||||
|
||||
/** @var integer Max image size for upload */
|
||||
protected $maxImageSize = 2000000;
|
||||
|
||||
/** @var array Errors displayed after post processing */
|
||||
public $_errors = array();
|
||||
|
||||
@@ -1140,7 +1137,7 @@ abstract class AdminSelfTab
|
||||
return false;
|
||||
|
||||
// Check image validity
|
||||
if ($error = checkImage($_FILES[$name], $this->maxImageSize))
|
||||
if ($error = checkImage($_FILES[$name]))
|
||||
$this->_errors[] = $error;
|
||||
elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES[$name]['tmp_name'], $tmpName))
|
||||
return false;
|
||||
@@ -1171,7 +1168,7 @@ abstract class AdminSelfTab
|
||||
if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name']))
|
||||
{
|
||||
/* Check ico validity */
|
||||
if ($error = checkIco($_FILES[$name], $this->maxImageSize))
|
||||
if ($error = checkIco($_FILES[$name]))
|
||||
$this->_errors[] = $error;
|
||||
|
||||
/* Copy new ico */
|
||||
|
||||
@@ -75,8 +75,6 @@ class blockreinsurance extends Module
|
||||
|
||||
public function addToDB()
|
||||
{
|
||||
$maxImageSize = 3007200;
|
||||
|
||||
if(isset($_POST['nbblocks']))
|
||||
{
|
||||
for($i = 1; $i <= (int)$_POST['nbblocks']; $i++)
|
||||
@@ -84,7 +82,7 @@ class blockreinsurance extends Module
|
||||
$filename = explode('.', $_FILES['info'.$i.'_file']['name']);
|
||||
if (isset($_FILES['info'.$i.'_file']) AND isset($_FILES['info'.$i.'_file']['tmp_name']) AND !empty($_FILES['info'.$i.'_file']['tmp_name']))
|
||||
{
|
||||
if ($error = checkImage($_FILES['info'.$i.'_file'], $maxImageSize))
|
||||
if ($error = checkImage($_FILES['info'.$i.'_file']))
|
||||
return false;
|
||||
elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['info'.$i.'_file']['tmp_name'], $tmpName))
|
||||
return false;
|
||||
|
||||
@@ -30,9 +30,6 @@ if (!defined('_PS_VERSION_'))
|
||||
|
||||
class Editorial extends Module
|
||||
{
|
||||
/** @var max image size */
|
||||
protected $maxImageSize = 307200;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'editorial';
|
||||
@@ -152,7 +149,7 @@ class Editorial extends Module
|
||||
Configuration::set('PS_IMAGE_GENERATION_METHOD', 1);
|
||||
if(file_exists(dirname(__FILE__).'/homepage_logo.jpg'))
|
||||
unlink(dirname(__FILE__).'/homepage_logo.jpg');
|
||||
if ($error = checkImage($_FILES['body_homepage_logo'], $this->maxImageSize))
|
||||
if ($error = checkImage($_FILES['body_homepage_logo']))
|
||||
$errors .= $error;
|
||||
elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['body_homepage_logo']['tmp_name'], $tmpName))
|
||||
return false;
|
||||
|
||||
@@ -34,7 +34,6 @@ class HomeSlide extends ObjectModel
|
||||
public $image;
|
||||
public $active;
|
||||
public $position;
|
||||
public $maxImageSize = 307200;
|
||||
|
||||
protected $fieldsValidate = array(
|
||||
'active' => 'isunsignedInt',
|
||||
|
||||
@@ -503,7 +503,7 @@ class HomeSlider extends Module
|
||||
/* Uploads image and sets slide */
|
||||
if (isset($_FILES['image_'.$language['id_lang']]) AND isset($_FILES['image_'.$language['id_lang']]['tmp_name']) AND !empty($_FILES['image_'.$language['id_lang']]['tmp_name']))
|
||||
{
|
||||
if ($error = checkImage($_FILES['image_'.$language['id_lang']], $slide->maxImageSize))
|
||||
if ($error = checkImage($_FILES['image_'.$language['id_lang']]))
|
||||
$errors .= $error;
|
||||
elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image_'.$language['id_lang']]['tmp_name'], $tmpName))
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,6 @@ class Watermark extends Module
|
||||
private $transparency;
|
||||
private $imageTypes = array();
|
||||
private $watermarkTypes;
|
||||
private $maxImageSize = 100000;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -132,7 +131,7 @@ class Watermark extends Module
|
||||
if (isset($_FILES['PS_WATERMARK']) AND !empty($_FILES['PS_WATERMARK']['tmp_name']))
|
||||
{
|
||||
/* Check watermark validity */
|
||||
if ($error = checkImage($_FILES['PS_WATERMARK'], $this->maxImageSize))
|
||||
if ($error = checkImage($_FILES['PS_WATERMARK']))
|
||||
$this->_errors[] = $error;
|
||||
/* Copy new watermark */
|
||||
elseif(!copy($_FILES['PS_WATERMARK']['tmp_name'], dirname(__FILE__).'/watermark.gif'))
|
||||
|
||||
Reference in New Issue
Block a user