From 5eed8d2a59ba293588d8591789c3410a7e3c5c36 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Tue, 6 Feb 2024 10:38:57 +0100 Subject: [PATCH] deprecated et warnings --- core/core.php | 8 ++++++-- core/include/comment.inc.php | 7 +++++-- core/layout/main.php | 4 +++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/core/core.php b/core/core.php index a3b8ba4..8296d27 100644 --- a/core/core.php +++ b/core/core.php @@ -1263,7 +1263,9 @@ class common { if ((sizeof($blocks) === 1 || in_array($this->getUrl(1),$pattern) ) ) { // Pleine page en mode configuration $this->showContent(); - if( $this->getData(['page', $this->getUrl(0), 'commentEnable']) === true && strlen($this->getUrl(1)) < 3 ) $this->showComment(); + $strlenUrl1 = 0; + if( $this->getUrl(1) !== null) $strlenUrl1 = strlen($this->getUrl(1)); + if( $this->getData(['page', $this->getUrl(0), 'commentEnable']) === true && $strlenUrl1 < 3 ) $this->showComment(); if (file_exists(self::DATA_DIR . 'body.inc.php')) { include( self::DATA_DIR . 'body.inc.php'); } @@ -1299,7 +1301,9 @@ class common { */ echo '
'; $this->showContent(); - if( $this->getData(['page', $this->getUrl(0), 'commentEnable']) === true && strlen($this->getUrl(1)) < 3 ) $this->showComment(); + $strlenUrl1 = 0; + if( $this->getUrl(1) !== null) $strlenUrl1 = strlen($this->getUrl(1)); + if( $this->getData(['page', $this->getUrl(0), 'commentEnable']) === true && $strlenUrl1 < 3 ) $this->showComment(); if (file_exists(self::DATA_DIR . 'body.inc.php')) { include(self::DATA_DIR . 'body.inc.php'); } diff --git a/core/include/comment.inc.php b/core/include/comment.inc.php index 71506ad..307b19f 100644 --- a/core/include/comment.inc.php +++ b/core/include/comment.inc.php @@ -28,7 +28,7 @@ if($this->isPost() && isset($_POST['commentPageFormSubmit']) ) { // $notice concerne la détection d'erreurs - $notice = ''; + $notice = ''; $detectBot=''; $code = null !== $this->getInput('codeCaptcha') ? $this->getInput('codeCaptcha') : ''; // Captcha demandée if( $this->getData(['config', 'social', 'comment', 'captcha']) ){ @@ -97,7 +97,8 @@ if($this->isPost() && isset($_POST['commentPageFormSubmit']) ) { } // Emission du mail // Rechercher l'adresse en fonction du mail - $singleuser = $this->getData(['user', $listUsers[$this->getData(['config', 'social', 'comment', 'user'])], 'mail']); + $singleuser = ''; + if( $this->getData(['config', 'social', 'comment', 'user']) !== '' ) $singleuser = $this->getData(['user', $listUsers[$this->getData(['config', 'social', 'comment', 'user'])], 'mail']); $singlemail = $this->getData(['config', 'social', 'comment', 'mail']); $group = $this->getData(['config', 'social', 'comment', 'group']); // Verification si le mail peut être envoyé @@ -167,6 +168,8 @@ if($this->isPost() && isset($_POST['commentPageFormSubmit']) ) { // Préparation de la liste paginée des commentaires // Initialisation de la pagination $nbPage =0; +$data=[]; +$pagesComment = ''; if ( !isset($_SESSION[$commentNumPage] )) $_SESSION[$commentNumPage] = 1; $dataPage = $this->getData(['comment', $this->getUrl(0), 'data']); if ( NULL !== $dataPage && is_array($dataPage) && $dataPage !== [] ) { diff --git a/core/layout/main.php b/core/layout/main.php index 2250f67..53d4324 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -17,7 +17,9 @@ else { echo ''; } - getData(['page', $this->getUrl(0), 'commentEnable']) === true && strlen($this->getUrl(1)) < 3 ) {?> + getUrl(1) !== null) $strlenUrl1 = strlen($this->getUrl(1)); + if( $this->getData(['page', $this->getUrl(0), 'commentEnable']) === true && $strlenUrl1 < 3 ) {?> showStyle(); $this->showSharedVariables();