mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Allow readFile() in CakeEmail to be accessed publicly
I needed this method while building a Transport, and saw no reason why it needed to be protected.
This commit is contained in:
parent
de7535d5a1
commit
f47609bd61
1 changed files with 3 additions and 3 deletions
|
@ -1359,7 +1359,7 @@ class CakeEmail {
|
|||
if (!empty($fileInfo['contentId'])) {
|
||||
continue;
|
||||
}
|
||||
$data = $this->_readFile($fileInfo['file']);
|
||||
$data = $this->readFile($fileInfo['file']);
|
||||
|
||||
$msg[] = '--' . $boundary;
|
||||
$msg[] = 'Content-Type: ' . $fileInfo['mimetype'];
|
||||
|
@ -1383,7 +1383,7 @@ class CakeEmail {
|
|||
* @param string $file The file to read.
|
||||
* @return string File contents in base64 encoding
|
||||
*/
|
||||
protected function _readFile($file) {
|
||||
public function readFile($file) {
|
||||
$handle = fopen($file, 'rb');
|
||||
$data = fread($handle, filesize($file));
|
||||
$data = chunk_split(base64_encode($data));
|
||||
|
@ -1407,7 +1407,7 @@ class CakeEmail {
|
|||
if (empty($fileInfo['contentId'])) {
|
||||
continue;
|
||||
}
|
||||
$data = $this->_readFile($fileInfo['file']);
|
||||
$data = $this->readFile($fileInfo['file']);
|
||||
|
||||
$msg[] = '--' . $boundary;
|
||||
$msg[] = 'Content-Type: ' . $fileInfo['mimetype'];
|
||||
|
|
Loading…
Reference in a new issue