From 88c3aae8921febf4bace98764febc00837d86685 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 18 Jul 2012 13:03:06 +0000 Subject: [PATCH] [-] BO : fix #PSCFV-3190 --- classes/ImageManager.php | 2 +- controllers/admin/AdminImportController.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/classes/ImageManager.php b/classes/ImageManager.php index 02b31a077..bf68be0c7 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -87,7 +87,7 @@ class ImageManagerCore */ public static function checkImageMemoryLimit($image) { - $infos = getimagesize($image); + $infos = @getimagesize($image); $memory_limit = Tools::getMemoryLimit(); // memory_limit == -1 => unlimited memory diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 28ae490b8..7a7670c05 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -1504,18 +1504,18 @@ class AdminImportControllerCore extends AdminController foreach (explode($fsep, $info['group']) as $key => $group) { $tab_group = explode(':', $group); - $group = $tab_group[0]; + $group = trim($tab_group[0]); if (!isset($tab_group[1])) $type = 'select'; else - $type = $tab_group[1]; + $type = trim($tab_group[1]); // sets group $groups_attributes[$key]['group'] = $group; // if position is filled if (isset($tab_group[2])) - $position = $tab_group[2]; + $position = trim($tab_group[2]); else $position = false; @@ -1558,10 +1558,10 @@ class AdminImportControllerCore extends AdminController foreach (explode($fsep, $info['attribute']) as $key => $attribute) { $tab_attribute = explode(':', $attribute); - $attribute = $tab_attribute[0]; + $attribute = trim($tab_attribute[0]); // if position is filled if (isset($tab_attribute[1])) - $position = $tab_attribute[1]; + $position = trim($tab_attribute[1]); else $position = false; @@ -2531,7 +2531,7 @@ class AdminImportControllerCore extends AdminController } } else if (!file_exists($_FILES['file']['tmp_name']) || - !@move_uploaded_file($_FILES['file']['tmp_name'], _PS_ADMIN_DIR_.'/import/'.$_FILES['file']['name'].'.'.date('Ymdhis'))) + !@move_uploaded_file($_FILES['file']['tmp_name'], _PS_ADMIN_DIR_.'/import/'.date('Ymdhis').'-'.$_FILES['file']['name'])) $this->errors[] = $this->l('an error occurred while uploading and copying file'); else Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=18');