From: marina Date: Wed, 28 May 2025 11:42:00 +0000 (+0300) Subject: ERP-417 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=ec708b5399a2e11f6b94203cef3eea9f35a81733;p=erp24_rep%2Fyii-erp24%2F.git ERP-417 --- diff --git a/erp24/records/Images.php b/erp24/records/Images.php index 9463eebe..67210757 100644 --- a/erp24/records/Images.php +++ b/erp24/records/Images.php @@ -80,7 +80,7 @@ class Images extends \yii\db\ActiveRecord $ar_size = !empty(getimagesize($file_obj->tempName)) ? getimagesize($file_obj->tempName) : ['', '']; $ar_file_name = explode('.', $file_obj->name); $ext = '.' . end($ar_file_name); - $file_name = pathinfo($file_obj->name, PATHINFO_FILENAME) . '_' . time() . rand(100,999) . '.' . strtolower(pathinfo($file_obj->name, PATHINFO_EXTENSION)); + $file_name = md5($file_obj->name . rand(100000, 999999)) . $ext; $dir_name = substr($file_name, 0, 2); $uploadDirPath = \Yii::getAlias('@uploads/images');