Fix some PHP notices

This commit is contained in:
Benjamin Renard 2019-03-12 12:49:19 +01:00
parent 68c6e4267b
commit 8bb4a1c9cf
5 changed files with 7 additions and 5 deletions

View file

@ -65,9 +65,10 @@ LSerror :: defineError('MAIL_01',
* @retval boolean true si MAIL est pleinement supporté, false sinon * @retval boolean true si MAIL est pleinement supporté, false sinon
*/ */
function sendMail($to,$subject,$msg,$headers=array()) { 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); $headers = array_merge($headers,$MAIL_HEARDERS);
} }
if ($subject) { if ($subject) {

View file

@ -96,7 +96,7 @@ class LSformElement_image extends LSformElement {
return true; 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"); $fp = fopen($_FILES[$this -> name]['tmp_name'], "r");
$buf = fread($fp, filesize($_FILES[$this -> name]['tmp_name'])); $buf = fread($fp, filesize($_FILES[$this -> name]['tmp_name']));
fclose($fp); fclose($fp);

View file

@ -87,6 +87,7 @@ class LSformElement_password extends LSformElement {
if ($this -> sendMail && LSsession :: loadLSaddon('mail')) { if ($this -> sendMail && LSsession :: loadLSaddon('mail')) {
$msg = $this -> getParam('html_options.mail.msg'); $msg = $this -> getParam('html_options.mail.msg');
$subject = $this -> getParam('html_options.mail.subject'); $subject = $this -> getParam('html_options.mail.subject');
$mail = "";
if (isset($_POST['LSformElement_password_'.$this -> name.'_msg'])) { if (isset($_POST['LSformElement_password_'.$this -> name.'_msg'])) {
$msgInfos = json_decode($_POST['LSformElement_password_'.$this -> name.'_msg']); $msgInfos = json_decode($_POST['LSformElement_password_'.$this -> name.'_msg']);
if ($msgInfos -> subject) { if ($msgInfos -> subject) {

View file

@ -368,7 +368,7 @@ class LSrelation {
$data['id'] = $_REQUEST['id']; $data['id'] = $_REQUEST['id'];
} }
else { else {
LSerror :: addErrorCode('LSrelations_03',$relationName); LSerror :: addErrorCode('LSrelations_03', $conf['relationName']);
} }
} }
else { else {

View file

@ -440,7 +440,7 @@ function LSdebugDefined() {
if (!is_array($chs)) { if (!is_array($chs)) {
$chs=array('chars' => $chs); $chs=array('chars' => $chs);
} }
if (!is_int($chs['nb'])) { if (!isset($chs['nb']) || !is_int($chs['nb'])) {
$chs['nb']=1; $chs['nb']=1;
} }
$retval.=aleaChar($chs['chars'],$chs['nb']); $retval.=aleaChar($chs['chars'],$chs['nb']);