From a164e380c3e6f784fb3fa47fe4dc72bdbde3fba4 Mon Sep 17 00:00:00 2001 From: mBertholino Date: Mon, 23 Jan 2012 16:32:22 +0000 Subject: [PATCH] [-] BO : #PSTEST-540 : bug fixed git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12617 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminThemesController.php | 40 ++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 421685901..690583d4d 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -451,15 +451,15 @@ class AdminThemesControllerCore extends AdminController { if ($error = ImageManager::validateUpload($_FILES['PS_LOGO'], 300000)) $this->errors[] = $error; - $tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS'); - if (!$tmpName || !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmpName)) + $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS'); + if (!$tmp_name || !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmp_name)) return false; - if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo.jpg')) + if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo.jpg')) $this->errors[] = 'an error occurred during logo copy'; - if (!@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo-'.(int)$id_shop.'.jpg')) + if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo-'.(int)$id_shop.'.jpg')) $this->errors[] = 'an error occurred during logo copy'; - unlink($tmpName); + unlink($tmp_name); } } @@ -473,14 +473,14 @@ class AdminThemesControllerCore extends AdminController { if ($error = ImageManager::validateUpload($_FILES['PS_LOGO_MAIL'], 300000)) $this->errors[] = $error; - $tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_MAIL'); - if (!$tmpName || !move_uploaded_file($_FILES['PS_LOGO_MAIL']['tmp_name'], $tmpName)) + $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS_MAIL'); + if (!$tmp_name || !move_uploaded_file($_FILES['PS_LOGO_MAIL']['tmp_name'], $tmp_name)) return false; - if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_mail.jpg')) + if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_mail.jpg')) $this->errors[] = 'an error occurred during logo copy'; - if (!@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_mail-'.(int)$id_shop.'.jpg')) + if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_mail-'.(int)$id_shop.'.jpg')) $this->errors[] = 'an error occurred during logo copy'; - unlink($tmpName); + unlink($tmp_name); } } @@ -494,15 +494,15 @@ class AdminThemesControllerCore extends AdminController { if ($error = ImageManager::validateUpload($_FILES['PS_LOGO_INVOICE'], 300000)) $this->errors[] = $error; - $tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_INVOICE'); - if (!$tmpName || !move_uploaded_file($_FILES['PS_LOGO_INVOICE']['tmp_name'], $tmpName)) + $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS_INVOICE'); + if (!$tmp_name || !move_uploaded_file($_FILES['PS_LOGO_INVOICE']['tmp_name'], $tmp_name)) return false; - if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_invoice.jpg')) + if ($id_shop == Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_invoice.jpg')) $this->errors[] = 'an error occurred during logo copy'; - if (!@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_invoice-'.(int)$id_shop.'.jpg')) + if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_invoice-'.(int)$id_shop.'.jpg')) $this->errors[] = 'an error occurred during logo copy'; - unlink($tmpName); + unlink($tmp_name); } } @@ -516,14 +516,14 @@ class AdminThemesControllerCore extends AdminController { if ($error = ImageManager::validateUpload($_FILES['PS_STORES_ICON'], 300000)) $this->errors[] = $error; - $tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_STORES_ICON'); - if (!$tmpName || !move_uploaded_file($_FILES['PS_STORES_ICON']['tmp_name'], $tmpName)) + $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS_STORES_ICON'); + if (!$tmp_name || !move_uploaded_file($_FILES['PS_STORES_ICON']['tmp_name'], $tmp_name)) return false; - if ($id_shop = Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_stores.gif')) + if ($id_shop = Configuration::get('PS_SHOP_DEFAULT') && !@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_stores.gif')) $this->errors[] = 'an error occurred during logo copy'; - if (!@ImageManager::resize($tmpName, _PS_IMG_DIR_.'logo_stores-'.(int)$id_shop.'.gif')) + if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.'logo_stores-'.(int)$id_shop.'.gif')) $this->errors[] = 'an error occurred during logo copy'; - unlink($tmpName); + unlink($tmp_name); } if ($id_shop = Configuration::get('PS_SHOP_DEFAULT'))