// Fix assignations in conditions with logical operators + normalize

This commit is contained in:
rMalie
2012-02-01 16:42:20 +00:00
parent 4c97888a66
commit 7501cb424c
7 changed files with 13 additions and 13 deletions
@@ -1340,7 +1340,7 @@ class AdminProductsControllerCore extends AdminController
if (!$new_path = $image->getPathForCreation())
$this->errors[] = Tools::displayError('An error occurred during new folder creation');
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName))
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName))
$this->errors[] = Tools::displayError('An error occurred during the image upload');
else if (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format))
$this->errors[] = Tools::displayError('An error occurred while copying image.');
+1 -1
View File
@@ -79,7 +79,7 @@ class AdminTagsControllerCore extends AdminController
public function postProcess()
{
if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd'.$this->table))
if ($id = (int)Tools::getValue($this->identifier) && $obj = new $this->className($id) && Validate::isLoadedObject($obj))
if (($id = (int)Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj))
$obj->setProducts($_POST['products']);
return parent::postProcess();
}