Skip to content

Commit

Permalink
Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/class/commonobject.class.php
  • Loading branch information
eldy committed Sep 27, 2018
2 parents 40bed96 + 4c8664b commit 291d477
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
36 changes: 31 additions & 5 deletions htdocs/core/class/CMailFile.class.php
Expand Up @@ -409,18 +409,44 @@ function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_li
// TODO if (! empty($moreinheader)) ...

// Give the message a subject
$this->message->setSubject($this->encodetorfc2822($subject));
try {
$this->message->setSubject($subject);
} catch (Exception $e) {
$this->error = $e->getMessage();
}

// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->setFrom($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}

// Set the To addresses with an associative array
if (! empty($to)) $this->message->setTo($this->getArrayAddress($to));
if (! empty($to)) {
try {
$result = $this->message->setTo($this->getArrayAddress($to));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}

if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->SetReplyTo($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}

$this->message->setCharSet($conf->file->character_set_client);
try {
$result = $this->message->setCharSet($conf->file->character_set_client);
} catch (Exception $e) {
$this->error = $e->getMessage();
}

if (! empty($this->html))
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/rssparser.class.php
Expand Up @@ -749,7 +749,7 @@ function xml2php($xml)
}

//Let see if the new child is not in the array
if($tab==false && in_array($key,array_keys($array)))
if($tab === false && in_array($key,array_keys($array)))
{
//If this element is already in the array we will create an indexed array
$tmp = $array[$key];
Expand All @@ -758,7 +758,7 @@ function xml2php($xml)
$array[$key][] = $child;
$tab = true;
}
elseif($tab == true)
elseif($tab === true)
{
//Add an element in an existing array
$array[$key][] = $child;
Expand Down

0 comments on commit 291d477

Please sign in to comment.