// Fix assignations in conditions with logical operators + normalize
This commit is contained in:
@@ -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.');
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ class AuthControllerCore extends FrontController
|
||||
{
|
||||
// if registration type is in one step, we save the address
|
||||
if (Configuration::get('PS_REGISTRATION_PROCESS_TYPE'))
|
||||
if (!$country = new Country($address->id_country, Configuration::get('PS_LANG_DEFAULT')) || !Validate::isLoadedObject($country))
|
||||
if (!($country = new Country($address->id_country, Configuration::get('PS_LANG_DEFAULT'))) || !Validate::isLoadedObject($country))
|
||||
die(Tools::displayError());
|
||||
$contains_state = isset($country) && is_object($country) ? (int)$country->contains_state: 0;
|
||||
$id_state = isset($address) && is_object($address) ? (int)$address->id_state: 0;
|
||||
|
||||
Reference in New Issue
Block a user