// Normalization

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8732 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-09-23 09:51:10 +00:00
parent df5e702f5c
commit a3fb583b98
+6 -5
View File
@@ -417,7 +417,7 @@ class ImageCore extends ObjectModel
{ {
$delete_folder = false; $delete_folder = false;
break; break;
} }
} }
if (isset($delete_folder) && $delete_folder) if (isset($delete_folder) && $delete_folder)
@rmdir($this->image_dir.$this->getImgFolder()); @rmdir($this->image_dir.$this->getImgFolder());
@@ -587,7 +587,7 @@ class ImageCore extends ObjectModel
$new_path = _PS_PROD_IMG_DIR_.$image->getImgPath().(isset($matches[3]) ? $matches[3] : '').'.jpg'; $new_path = _PS_PROD_IMG_DIR_.$image->getImgPath().(isset($matches[3]) ? $matches[3] : '').'.jpg';
if (file_exists($new_path)) if (file_exists($new_path))
{ {
if(!file_exists(_PS_PROD_IMG_DIR_.$tmp_folder)) if (!file_exists(_PS_PROD_IMG_DIR_.$tmp_folder))
{ {
@mkdir(_PS_PROD_IMG_DIR_.$tmp_folder, $access_rights); @mkdir(_PS_PROD_IMG_DIR_.$tmp_folder, $access_rights);
@chmod(_PS_PROD_IMG_DIR_.$tmp_folder, $access_rights); @chmod(_PS_PROD_IMG_DIR_.$tmp_folder, $access_rights);
@@ -641,16 +641,17 @@ class ImageCore extends ObjectModel
{ {
if (!$this->id) if (!$this->id)
return false; return false;
if(Configuration::get('PS_LEGACY_IMAGES')) if (Configuration::get('PS_LEGACY_IMAGES'))
{ {
if (!$this->id_product) if (!$this->id_product)
return false; return false;
$path = $this->id_product.'-'.$this->id; $path = $this->id_product.'-'.$this->id;
} else }
else
{ {
$path = $this->getImgPath(); $path = $this->getImgPath();
$this->createImgFolder(); $this->createImgFolder();
} }
return _PS_PROD_IMG_DIR_.$path; return _PS_PROD_IMG_DIR_.$path;
} }
} }