// Fix assignations in conditions with logical operators + normalize

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12912 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-01 16:42:20 +00:00
parent 3f67f95a5c
commit 7fe9fd241d
7 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -153,14 +153,14 @@ class Editorial extends Module
$editorial->update();
/* upload the image */
if (isset($_FILES['body_homepage_logo']) AND isset($_FILES['body_homepage_logo']['tmp_name']) AND !empty($_FILES['body_homepage_logo']['tmp_name']))
if (isset($_FILES['body_homepage_logo']) && isset($_FILES['body_homepage_logo']['tmp_name']) && !empty($_FILES['body_homepage_logo']['tmp_name']))
{
Configuration::set('PS_IMAGE_GENERATION_METHOD', 1);
if(file_exists(dirname(__FILE__).'/homepage_logo.jpg'))
unlink(dirname(__FILE__).'/homepage_logo.jpg');
if ($error = ImageManager::validateUpload($_FILES['body_homepage_logo']))
$errors .= $error;
elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['body_homepage_logo']['tmp_name'], $tmpName))
elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['body_homepage_logo']['tmp_name'], $tmpName))
return false;
elseif (!ImageManager::resize($tmpName, dirname(__FILE__).'/homepage_logo.jpg'))
$errors .= $this->displayError($this->l('An error occurred during the image upload.'));