Merge pull request #643 from Shagshag/patch-2

[*] BO :ProductDownload::getNewFilename() avoid recursion
This commit is contained in:
Gregory Roussac committed 2013-08-12 00:29:33 -07:00
commit b7232aabd7
1 file changed
+5 -5
+5 -5
View File
@@ -299,10 +299,10 @@ class ProductDownloadCore extends ObjectModel
*/ */
public static function getNewFilename() public static function getNewFilename()
{ {
$ret = sha1(microtime()); do {
if (file_exists(_PS_DOWNLOAD_DIR_.$ret)) $filename = sha1(microtime());
$ret = ProductDownload::getNewFilename(); } while (file_exists(_PS_DOWNLOAD_DIR_.$filename));
return $ret; return $filename;
} }
/** /**
@@ -314,4 +314,4 @@ class ProductDownloadCore extends ObjectModel
{ {
return Configuration::get('PS_VIRTUAL_PROD_FEATURE_ACTIVE'); return Configuration::get('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
} }
} }