From a8fa1ad2afbd65e851ed7da9475e6d926719b83b Mon Sep 17 00:00:00 2001
From: Matthieu Marcillaud <marcimat@rezo.net>
Date: Thu, 11 May 2023 16:49:06 +0200
Subject: [PATCH] fix: Notice PHP, qui bloque les crayons

---
 tradlang_pipelines.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tradlang_pipelines.php b/tradlang_pipelines.php
index 4000ab0..2667d78 100644
--- a/tradlang_pipelines.php
+++ b/tradlang_pipelines.php
@@ -74,7 +74,10 @@ function tradlang_post_edition($flux) {
 		$config = lire_config('tradlang');
 		if (!is_array($config)) {
 			return $flux;
-		} elseif ($config['sauvegarde_locale'] == 'on' && $config['sauvegarde_post_edition'] == 'on') {
+		} elseif (
+			($config['sauvegarde_locale'] ?? null) === 'on'
+			&& ($config['sauvegarde_post_edition'] ?? null) === 'on'
+		) {
 			include_spip('tradlang_fonctions');
 			if ($dir_lang = tradlang_dir_lang()) {
 				$infos = sql_fetsel('lang,module', $flux['args']['table'], 'id_tradlang=' . (int) $flux['args']['id_objet']);
-- 
GitLab