From 751bc450b51951b8f5d40d0253ed98eb24f767db Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 1 Jun 2024 21:20:41 +0200 Subject: [PATCH] 1.10.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ** Corrections :** - L'ajout d'un slash en fin d'adresse avec la réécriture active provoquait une mauvaise détermination des adresses des images dans TinyMCE. Résolution : une directive htaccess supprime tous les slash en fin d'adresse. - Lorsque la page est ouverte en édition, un clic sur le bouton édition dans la barre d'administration affiche une erreur, le lien étant incorrect. Afin d'éviter cette erreur et une redondance, le bouton d'édition est masqué lorsque la page est éditée. --- README.md | 2 +- core/class/layout.class.php | 2 +- core/core.php | 2 +- core/module/config/config.php | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 79c0880..0c2f4cf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZwiiCampus 1.10.03 +# ZwiiCampus 1.10.04 ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé. diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 8c891b2..6c0f9b6 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -1018,7 +1018,7 @@ class layout extends common or $this->getUrl(0) === '' ) { // Bouton Editer une page - if ($this->getUser('permission', 'page', 'edit')) { + if ($this->getUser('permission', 'page', 'edit') and $this->geturl(1) !== 'edit') { $leftItems .= '
  • ' . template::ico('pencil', [ 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'help' => 'Éditer la page' diff --git a/core/core.php b/core/core.php index 9581333..5194600 100644 --- a/core/core.php +++ b/core/core.php @@ -51,7 +51,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '1.10.03'; + const ZWII_VERSION = '1.10.04'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; diff --git a/core/module/config/config.php b/core/module/config/config.php index bcc4134..282f901 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -490,7 +490,7 @@ class config extends common 'cookiesFooterText' => $this->getInput('configLocaleCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN)), 'buttonValidLabel' => $this->getInput('configLocaleCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN)), ], - 'social' => [ + 'social' => [ 'facebookId' => $this->getInput('socialFacebookId'), 'linkedinId' => $this->getInput('socialLinkedinId'), 'instagramId' => $this->getInput('socialInstagramId'), @@ -557,6 +557,12 @@ class config extends common // Ajout des lignes dans le .htaccess $fileContent = file_get_contents('.htaccess'); $rewriteData = PHP_EOL . + ' # Enlever le slash final des URL' . PHP_EOL . + 'RewriteCond %{REQUEST_FILENAME} !-f' . PHP_EOL . + 'RewriteCond %{REQUEST_FILENAME} !-d' . PHP_EOL . + 'RewriteCond %{REQUEST_URI} ^(.+)/$' . PHP_EOL . + 'RewriteRule ^ %1 [R=301,L]' . PHP_EOL . + PHP_EOL . '# URL rewriting' . PHP_EOL . '' . PHP_EOL . "\tRewriteEngine on" . PHP_EOL .