From 40b731d4503dbd05f544f84173b8831777b24306 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 12 Sep 2023 22:28:05 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20d'appels=20inutiles=20=C3=A0=20ch?= =?UTF-8?q?eckcsrf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/plugin/plugin.php | 9 --------- core/module/theme/theme.php | 3 +-- core/module/user/user.php | 10 ---------- module/gallery/gallery.php | 8 -------- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/core/module/plugin/plugin.php b/core/module/plugin/plugin.php index 9ff897c..795f657 100644 --- a/core/module/plugin/plugin.php +++ b/core/module/plugin/plugin.php @@ -808,15 +808,6 @@ class plugin extends common } // Bouton d'importation des données d'un module spécifique if (count(explode('/', $this->getUrl())) === 6) { - // Action interdite - if ($this->checkCSRF()) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'plugin', - 'state' => false, - 'notification' => helper::translate('Action interdite') - ]); - } // Traitement diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 4450f4b..fa0b537 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -822,8 +822,7 @@ class theme extends common { // Action interdite if ( - $this->getUser('permission', __CLASS__, __FUNCTION__) !== true || - $this->checkCSRF() + $this->getUser('permission', __CLASS__, __FUNCTION__) !== true ) { // Valeurs en sortie // Valeurs en sortie diff --git a/core/module/user/user.php b/core/module/user/user.php index e57760d..dbc37ed 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -202,16 +202,6 @@ class user extends common 'access' => false ]); } - // Action interdite - elseif ( - $this->checkCSRF() - ) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'user', - 'notification' => helper::translate('Action interdite') - ]); - } // Bloque la suppression de son propre compte elseif ($this->getUser('id') === $this->getUrl(2)) { // Valeurs en sortie diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 1a8ede3..aca5802 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -957,14 +957,6 @@ class gallery extends common * Enregistre les options de configuration de la galerie d'images sélectionnée */ } elseif ($this->getUrl(2) === 'gallery') { - // Action interdite - if ($this->checkCSRF()) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/edit', - 'notification' => helper::translate('Action interdite') - ]); - } // Soumission du formulaire if ( $this->getUser('permission', __CLASS__, __FUNCTION__) === true &&