From 5883ca1af20d3fbe59252e301e0e4c1adb05ebb5 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 15 Oct 2023 21:06:31 +0200 Subject: [PATCH] cosmetic clean --- CHANGELOG.md | 6 +++++ README.md | 8 +++---- _define.php | 35 +++++++++++++---------------- dcstore.xml | 4 ++-- src/CleanURLs.php | 56 ++++++++++++++++++++++++++--------------------- src/My.php | 21 +++++++++--------- src/Prepend.php | 20 ++++++++--------- 7 files changed, 77 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af839c9..67d82cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +cleanURLs 1.6.1 - 2023.10.15 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1+ +* Cosmetic clean + cleanURLs 1.6 - 2023.10.07 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index 48cebbf..f06f532 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # README -[![Release](https://img.shields.io/badge/release-1.6-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/cleanURLs/releases) -![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg) +[![Release](https://img.shields.io/badge/release-1.6.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/cleanURLs/releases) +![Date](https://img.shields.io/badge/date-2023.10.15-c44d58.svg) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/cleanURLs) -[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/cleanURLs/src/branch/master/LICENSE) +[![License](https://img.shields.io/badge/license-GPL--3.0-ececec.svg)](https://git.dotclear.watch/JcDenis/cleanURLs/src/branch/master/LICENSE) ## ABOUT @@ -33,6 +33,6 @@ Then when a post is created, it's URL is cleaned automagically. ## CONTRIBUTORS * Pierre Rudloff (author) -* Jean-Christian Denis +* Jean-Christian Denis (latest) You are welcome to contribute to this code. diff --git a/_define.php b/_define.php index 54c5ca3..bc2f3f2 100644 --- a/_define.php +++ b/_define.php @@ -1,35 +1,30 @@ registerModule( 'Clean URLs', 'Removes diacritics and punctuation from URLs', 'Pierre Rudloff and contributors', - '1.6', + '1.6.1', [ 'requires' => [['core', '2.28']], - 'permissions' => App::auth()->makePermissions([ - App::auth()::PERMISSION_USAGE, - App::auth()::PERMISSION_CONTENT_ADMIN, - ]), - 'type' => 'plugin', - 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', - 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', - 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', + 'permissions' => 'My', + 'type' => 'plugin', + 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', + 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', + 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', ] ); diff --git a/dcstore.xml b/dcstore.xml index fbd0b10..941a7ba 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Clean URLs - 1.6 + 1.6.1 Pierre Rudloff and contributors Removes diacritics and punctuation from URLs - https://git.dotclear.watch/JcDenis/cleanURLs/releases/download/v1.6/plugin-cleanURLs.zip + https://git.dotclear.watch/JcDenis/cleanURLs/releases/download/v1.6.1/plugin-cleanURLs.zip 2.28 https://git.dotclear.watch/JcDenis/cleanURLs/src/branch/master/README.md https://git.dotclear.watch/JcDenis/cleanURLs/issues diff --git a/src/CleanURLs.php b/src/CleanURLs.php index a13befb..8271650 100644 --- a/src/CleanURLs.php +++ b/src/CleanURLs.php @@ -1,42 +1,48 @@ - * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License - * @link http://rudloff.pro - * */ + * @author Pierre Rudloff (author) + * @author Jean-Christian Denis (latest) + * @copyright GPL-3.0 https://www.gnu.org/licenses/gpl-3.0.html + */ class CleanURLs { + /** + * Chars to convert from. + * + * @var string CONVERT_FROM_CHARS + */ public const CONVERT_FROM_CHARS = ',!.?;:@$«»°*'; - public const CONVERT_TO_CHAR = '-'; - /** @var string $convert_from_chars List of special chars to convert */ + /** + * Chars to convert to. + * + * @var string CONVERT_TO_CHAR + */ + public const CONVERT_TO_CHAR = '-'; + + /** + * List of special chars to convert. + * + * @var string $convert_from_chars + */ public static string $convert_from_chars = self::CONVERT_FROM_CHARS; - /** @var string $convert_to_char A char to convert to */ + /** + * A char to convert to. + * + * @var string $convert_to_char + */ public static string $convert_to_char = self::CONVERT_TO_CHAR; /** @@ -272,7 +278,7 @@ class CleanURLs * @param Blog $blog The blog instance * @param Cursor $cur The post Cursor * */ - public static function cleanPost(Blog $blog, Cursor $cur): void + public static function cleanPost(BlogInterface $blog, Cursor $cur): void { $cur->setField('post_url', self::cleanStr($cur->getField('post_url'))); } diff --git a/src/My.php b/src/My.php index 3ac76de..78ffb4c 100644 --- a/src/My.php +++ b/src/My.php @@ -1,21 +1,20 @@