// Normalization
This commit is contained in:
1 parent
185cba8026
commit
4dd85d92c0
1 file changed
+6
-5
+6
-5
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user