ProductDownload::getNewFilename() little optimisation
Avoid recursion
This commit is contained in:
@@ -299,10 +299,10 @@ class ProductDownloadCore extends ObjectModel
|
||||
*/
|
||||
public static function getNewFilename()
|
||||
{
|
||||
$ret = sha1(microtime());
|
||||
if (file_exists(_PS_DOWNLOAD_DIR_.$ret))
|
||||
$ret = ProductDownload::getNewFilename();
|
||||
return $ret;
|
||||
do {
|
||||
$filename = sha1(microtime());
|
||||
} while (file_exists(_PS_DOWNLOAD_DIR_.$filename));
|
||||
return $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,4 +314,4 @@ class ProductDownloadCore extends ObjectModel
|
||||
{
|
||||
return Configuration::get('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user