diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 373effecbe8..56361b948f0 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -226,7 +226,7 @@ if ($action == 'builddoc') {
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
- 'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
+ 'photo'=>!empty($barcodeimage) ? $barcodeimage : '' // Photo must be a file that exists with format supported by TCPDF
);
}
} else {
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index e730243bfbf..9d84e205f2b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -2048,7 +2048,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
}
if (!empty($contact_id) && $contact_id > 0) {
- if (!is_object($cachecontacts[$contact_id])) {
+ if (empty($cachecontacts[$contact_id]) || !is_object($cachecontacts[$contact_id])) {
$contact = new Contact($db);
$contact->fetch($contact_id);
$cachecontacts[$contact_id] = $contact;
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index dde6e3204d6..c39e4fbf834 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -675,7 +675,7 @@ if ($object->fetch($id) >= 0) {
// Date last update
print '
';
- print dol_print_date($obj->tms, 'dayhour');
+ print dol_print_date(dol_stringtotime($obj->tms), 'dayhour');
print ' | ';
// Status of recipient sending email (Warning != status of emailing)
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index d3ebc379b55..cf3d18adbac 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -101,7 +101,7 @@ if (is_resource($handle)) {
$qualified = 1;
foreach ($mailmodule->require_module as $key) {
- if (!$conf->$key->enabled || (!$user->admin && $mailmodule->require_admin)) {
+ if (empty($conf->$key->enabled) || (!$user->admin && $mailmodule->require_admin)) {
$qualified = 0;
//print "Les pr�requis d'activation du module mailing ne sont pas respect�s. Il ne sera pas actif";
break;
@@ -176,7 +176,7 @@ if ($result) {
print '';
print '| '.$mailstatic->getNomUrl(1).' | ';
- print ''.dol_trunc($obj->title, 38).' | ';
+ print ''.(!empty($obj->title) ? dol_trunc($obj->title, 38) : '').' | ';
print ''.dol_print_date($db->jdate($obj->date_creat), 'day').' | ';
print ''.($obj->nbemail ? $obj->nbemail : "0").' | ';
print ''.$mailstatic->LibStatut($obj->statut, 5).' | ';
diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
index b75d0752334..5a6dbbedd37 100644
--- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
+++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
@@ -120,7 +120,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
while ($i < $num) {
$objp = $this->db->fetch_object($resql);
while ($minimumdatecformated < $objp->datec) {
- $dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
+ $dataseries[] = array('label' => dol_print_date($minimumdatec, 'day'), 'data' => 0);
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
}
@@ -130,7 +130,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
$i++;
}
while (count($dataseries) < $days) {
- $dataseries[] = array('label' => dol_print_date($minimumdatecformated, 'day'), 'data' => 0);
+ $dataseries[] = array('label' => dol_print_date($minimumdatec, 'day'), 'data' => 0);
$minimumdatec = dol_time_plus_duree($minimumdatec, $intervaltoadd, 'd');
$minimumdatecformated = dol_print_date($minimumdatec, 'dayrfc');
$i++;
diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php
index b685147a9b9..caf2ff00b03 100644
--- a/htdocs/hrm/class/position.class.php
+++ b/htdocs/hrm/class/position.class.php
@@ -395,10 +395,10 @@ class Position extends CommonObject
foreach ($filter as $key => $value) {
if ($key == 't.rowid') {
$sqlwhere[] = $key . '=' . $value;
- } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
- $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\'';
} elseif ($key == 'customsql') {
$sqlwhere[] = $value;
+ } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
+ $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\'';
} elseif (strpos($value, '%') === false) {
$sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')';
} else {
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index b8810a2696d..0d2137928ac 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -3739,7 +3739,7 @@ if ($module == 'initmodule') {
print '';
print '';
- print dol_escape_htmltag($menu['leftmenu']);
+ print !empty($menu['leftmenu']) ? dol_escape_htmltag($menu['leftmenu']) : '';
print ' | ';
print '';
|