Skip to content

Commit d764998

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-92170: Redundant File Names for Quote Attachments
1 parent 03ab0fd commit d764998

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/internal/Magento/Framework/File/Uploader.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,22 @@ public function save($destinationFolder, $newFileName = null)
204204
$this->_result = false;
205205
$destinationFile = $destinationFolder;
206206
$fileName = isset($newFileName) ? $newFileName : $this->_file['name'];
207-
$fileName = self::getCorrectFileName($fileName);
207+
$fileName = static::getCorrectFileName($fileName);
208208
if ($this->_enableFilesDispersion) {
209209
$fileName = $this->correctFileNameCase($fileName);
210210
$this->setAllowCreateFolders(true);
211-
$this->_dispretionPath = self::getDispersionPath($fileName);
211+
$this->_dispretionPath = static::getDispersionPath($fileName);
212212
$destinationFile .= $this->_dispretionPath;
213213
$this->_createDestinationFolder($destinationFile);
214214
}
215215

216216
if ($this->_allowRenameFiles) {
217-
$fileName = self::getNewFileName(self::_addDirSeparator($destinationFile) . $fileName);
217+
$fileName = static::getNewFileName(
218+
static::_addDirSeparator($destinationFile) . $fileName
219+
);
218220
}
219221

220-
$destinationFile = self::_addDirSeparator($destinationFile) . $fileName;
222+
$destinationFile = static::_addDirSeparator($destinationFile) . $fileName;
221223

222224
try {
223225
$this->_result = $this->_moveFile($this->_file['tmp_name'], $destinationFile);

nginx.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ location /media/import/ {
161161
}
162162

163163
# PHP entry point for main application
164-
location ~ (index|get|static|report|404|503|health_check)\.php$ {
164+
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
165165
try_files $uri =404;
166166
fastcgi_pass fastcgi_backend;
167167
fastcgi_buffers 1024 4k;

0 commit comments

Comments
 (0)