]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Wed, 28 May 2025 11:42:00 +0000 (14:42 +0300)
committermarina <m.zozirova@gmail.com>
Wed, 28 May 2025 11:42:00 +0000 (14:42 +0300)
erp24/records/Images.php

index 9463eebef4f055a511adbf4d4e68daed7cca75b1..67210757169b38e76e6da91560caa4ecf8684683 100644 (file)
@@ -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');