// small change in blockstore logo name
This commit is contained in:
@@ -92,13 +92,15 @@ class BlockStore extends Module
|
|||||||
return $this->displayError($this->l('Invalid image'));
|
return $this->displayError($this->l('Invalid image'));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!move_uploaded_file($_FILES['store_img']['tmp_name'], dirname(__FILE__).'/'.$_FILES['store_img']['name']))
|
$ext = substr($_FILES['store_img']['name'], strrpos($_FILES['store_img']['name'], '.') + 1);
|
||||||
|
$file_name = md5($_FILES['store_img']['name']).'.'.$ext;
|
||||||
|
if (!move_uploaded_file($_FILES['store_img']['tmp_name'], dirname(__FILE__).'/'.$file_name))
|
||||||
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
|
return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $_FILES['store_img']['name'])
|
if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $file_name)
|
||||||
@unlink(dirname(__FILE__).'/'.Configuration::get('BLOCKSTORE_IMG'));
|
@unlink(dirname(__FILE__).'/'.Configuration::get('BLOCKSTORE_IMG'));
|
||||||
Configuration::updateValue('BLOCKSTORE_IMG', $_FILES['store_img']['name']);
|
Configuration::updateValue('BLOCKSTORE_IMG', $file_name);
|
||||||
$this->_clearCache('blockstore.tpl');
|
$this->_clearCache('blockstore.tpl');
|
||||||
return $this->displayConfirmation($this->l('The settings have been updated.'));
|
return $this->displayConfirmation($this->l('The settings have been updated.'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user