From 8bb4a1c9cfda6386b43d659231c6dc410b037108 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 12 Mar 2019 12:49:19 +0100 Subject: [PATCH] Fix some PHP notices --- public_html/includes/addons/LSaddons.mail.php | 5 +++-- public_html/includes/class/class.LSformElement_image.php | 2 +- public_html/includes/class/class.LSformElement_password.php | 1 + public_html/includes/class/class.LSrelation.php | 2 +- public_html/includes/functions.php | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public_html/includes/addons/LSaddons.mail.php b/public_html/includes/addons/LSaddons.mail.php index eda7c401..7e079349 100644 --- a/public_html/includes/addons/LSaddons.mail.php +++ b/public_html/includes/addons/LSaddons.mail.php @@ -65,9 +65,10 @@ LSerror :: defineError('MAIL_01', * @retval boolean true si MAIL est pleinement supporté, false sinon */ function sendMail($to,$subject,$msg,$headers=array()) { - $mail_obj = & Mail::factory(MAIL_SEND_METHOD, $MAIL_SEND_PARAMS); + global $MAIL_SEND_PARAMS, $MAIL_HEARDERS; + $mail_obj = Mail::factory(MAIL_SEND_METHOD, (isset($MAIL_SEND_PARAMS)?$MAIL_SEND_PARAMS:null)); - if(is_array($MAIL_HEARDERS)) { + if (isset($MAIL_HEARDERS) && is_array($MAIL_HEARDERS)) { $headers = array_merge($headers,$MAIL_HEARDERS); } if ($subject) { diff --git a/public_html/includes/class/class.LSformElement_image.php b/public_html/includes/class/class.LSformElement_image.php index 4a62b1d2..16e70f8d 100644 --- a/public_html/includes/class/class.LSformElement_image.php +++ b/public_html/includes/class/class.LSformElement_image.php @@ -96,7 +96,7 @@ class LSformElement_image extends LSformElement { return true; } - if (is_uploaded_file($_FILES[$this -> name]['tmp_name'])) { + if (isset($_FILES[$this -> name]) && isset($_FILES[$this -> name]['tmp_name']) && is_uploaded_file($_FILES[$this -> name]['tmp_name'])) { $fp = fopen($_FILES[$this -> name]['tmp_name'], "r"); $buf = fread($fp, filesize($_FILES[$this -> name]['tmp_name'])); fclose($fp); diff --git a/public_html/includes/class/class.LSformElement_password.php b/public_html/includes/class/class.LSformElement_password.php index 279a2f28..c7b10443 100644 --- a/public_html/includes/class/class.LSformElement_password.php +++ b/public_html/includes/class/class.LSformElement_password.php @@ -87,6 +87,7 @@ class LSformElement_password extends LSformElement { if ($this -> sendMail && LSsession :: loadLSaddon('mail')) { $msg = $this -> getParam('html_options.mail.msg'); $subject = $this -> getParam('html_options.mail.subject'); + $mail = ""; if (isset($_POST['LSformElement_password_'.$this -> name.'_msg'])) { $msgInfos = json_decode($_POST['LSformElement_password_'.$this -> name.'_msg']); if ($msgInfos -> subject) { diff --git a/public_html/includes/class/class.LSrelation.php b/public_html/includes/class/class.LSrelation.php index 4fa21563..5f5d1cd7 100644 --- a/public_html/includes/class/class.LSrelation.php +++ b/public_html/includes/class/class.LSrelation.php @@ -368,7 +368,7 @@ class LSrelation { $data['id'] = $_REQUEST['id']; } else { - LSerror :: addErrorCode('LSrelations_03',$relationName); + LSerror :: addErrorCode('LSrelations_03', $conf['relationName']); } } else { diff --git a/public_html/includes/functions.php b/public_html/includes/functions.php index 9366f6cb..c19e1c80 100644 --- a/public_html/includes/functions.php +++ b/public_html/includes/functions.php @@ -440,7 +440,7 @@ function LSdebugDefined() { if (!is_array($chs)) { $chs=array('chars' => $chs); } - if (!is_int($chs['nb'])) { + if (!isset($chs['nb']) || !is_int($chs['nb'])) { $chs['nb']=1; } $retval.=aleaChar($chs['chars'],$chs['nb']);