mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 20:12:42 +00:00
Retain the original file name so errors can be generated properly.
We should hold onto the original file so we can generate a error message when the file is not found. Fixes #2990 Closes #3011
This commit is contained in:
parent
fda242f000
commit
7b2ac816c6
1 changed files with 2 additions and 3 deletions
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP Email
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -1022,9 +1020,10 @@ class CakeEmail {
|
|||
}
|
||||
$fileInfo['data'] = chunk_split(base64_encode($fileInfo['data']), 76, "\r\n");
|
||||
} else {
|
||||
$fileName = $fileInfo['file'];
|
||||
$fileInfo['file'] = realpath($fileInfo['file']);
|
||||
if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) {
|
||||
throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileInfo['file']));
|
||||
throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileName));
|
||||
}
|
||||
if (is_int($name)) {
|
||||
$name = basename($fileInfo['file']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue