From d15c52db3b8e9614e868e02ed96761ffc8017611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Sep 2018 08:16:05 +0200 Subject: [PATCH 1/4] Update rssparser.class.php --- htdocs/core/class/rssparser.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 56e338b7eb8..1417b9a0e29 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -742,7 +742,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]; @@ -751,7 +751,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; From 92a3faeaf76df2b31e2fdc2302e3d33e0aa05abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Sep 2018 10:13:14 +0200 Subject: [PATCH 2/4] add try catch for swiftmailer --- htdocs/core/class/CMailFile.class.php | 36 +++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8313894f68c..9bd17a9670a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -407,18 +407,44 @@ class CMailFile // TODO if (! empty($moreinheader)) ... // Give the message a subject - $this->message->setSubject($this->encodetorfc2822($subject)); + try { + $this->message->setSubject($this->encodetorfc2822($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)) { From 1bac3a0ccfc4ce81a76eca8b3734b0d22d8f14ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Sep 2018 10:37:20 +0200 Subject: [PATCH 3/4] swiftmailer is doing encodetorfc2822 --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 9bd17a9670a..bb38563837a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -408,7 +408,7 @@ class CMailFile // Give the message a subject try { - $this->message->setSubject($this->encodetorfc2822($subject)); + $this->message->setSubject($subject); } catch (Exception $e) { $this->error = $e->getMessage(); } From af93fc74846f500b26c96a34b1b3729e0598ef19 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 26 Sep 2018 17:19:06 +0200 Subject: [PATCH 4/4] FIX: showOptionals: column mismatches --- htdocs/core/class/commonobject.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e9498d52d7d..47fabb6e2dc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4524,7 +4524,7 @@ abstract class CommonObject { if (is_array($params) && count($params)>0) { if (array_key_exists('colspan',$params)) { - $colspan=$params['colspan']; + $colspan=$params['colspan'] - 1; } }else { $colspan='3'; @@ -4581,6 +4581,12 @@ abstract class CommonObject if($extrafields->attribute_required[$key]) $label = ''.$label.''; + if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) + { + $out .= ' '; + $colspan--; + } + $out .= ''.$langs->trans($label).''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; $out .='';