ProductDownload::getNewFilename() little optimisation

Avoid recursion
This commit is contained in:
Shagshag
2013-08-12 04:28:58 +02:00
parent a38fe5ddd3
commit ce20d55e77
+4 -4
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;
} }
/** /**