forked from Wavyzz/dolibarr
Fix: Use filesystem encoding
This commit is contained in:
@@ -466,12 +466,12 @@ class CMailFile
|
||||
/**
|
||||
* Read a file on disk and return encoded content for emails (mode = 'mail')
|
||||
*
|
||||
* @param sourcefile
|
||||
* @return <0 if KO, encoded string if OK
|
||||
* @param string $sourcefile Path to file to encode
|
||||
* @return int <0 if KO, encoded string if OK
|
||||
*/
|
||||
function _encode_file($sourcefile)
|
||||
{
|
||||
$newsourcefile=utf8_check($sourcefile)?utf8_decode($sourcefile):$sourcefile; // is_readable and file_get_contents need ISO filename
|
||||
$newsourcefile=dol_osencode($sourcefile);
|
||||
|
||||
if (is_readable($newsourcefile))
|
||||
{
|
||||
@@ -481,7 +481,7 @@ class CMailFile
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error="Error: Can't read file '$sourcefile'";
|
||||
$this->error="Error: Can't read file '".$sourcefile."' into _encode_file";
|
||||
dol_syslog("CMailFile::encode_file: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
@@ -491,6 +491,8 @@ class CMailFile
|
||||
/**
|
||||
* Write content of a SMTP request into a dump file (mode = all)
|
||||
* Used for debugging.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function dump_mail()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user