From 60fd01ec60b0b57b709b84b4d523f8e055775889 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Thu, 22 Dec 2011 15:39:38 +0000 Subject: [PATCH] =?UTF-8?q?[-]=20BO=20:=20#PSTEST-129=20:=20FO=20-=20Erreu?= =?UTF-8?q?r=20lors=20de=20l'upload=20de=20fichiers=20personnalis=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11622 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/front/ProductController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 3c25e20b2..dd34f3144 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -129,7 +129,7 @@ class ProductControllerCore extends FrontController $this->textRecord($this->product, $this->context->cart); $this->formTargetFormat(); } - else if (Tools::getIsset('deletePicture') && !$this->context->cart->deletePictureToProduct($this->product->id, Tools::getValue('deletePicture'))) + else if (Tools::getIsset('deletePicture') && !$this->context->cart->deleteCustomizationToProduct((int)$this->product->id, (int)Tools::getValue('deletePicture'))) $this->errors[] = Tools::displayError('An error occurred while deleting the selected picture'); $files = $this->context->cart->getProductCustomization($this->product->id, Product::CUSTOMIZE_FILE, true); @@ -470,7 +470,7 @@ class ProductControllerCore extends FrontController $product_picture_width = (int)Configuration::get('PS_PRODUCT_PICTURE_WIDTH'); $product_picture_height = (int)Configuration::get('PS_PRODUCT_PICTURE_HEIGHT'); - if ($error || (!$tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !move_uploaded_file($file['tmp_name'], $tmp_name))) + if ($error || (!$tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmp_name))) return false; /* Original file */ else if (!imageResize($tmp_name, _PS_UPLOAD_DIR_.$file_name)) @@ -485,7 +485,7 @@ class ProductControllerCore extends FrontController // Store customization in database $cart->addPictureToProduct($this->product->id, $indexes[$field_name], Product::CUSTOMIZE_FILE, $file_name); } - unlink($tmp_name); + @unlink($tmp_name); } return true; }