From 03faaaedef0abbc928a782e978912b6ccf211ab0 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 24 Jan 2020 17:40:09 +0100 Subject: [PATCH] Use Laravel's slugger for basic transliteration This is better than the current system, as it adds transliteration rules for special characters, rather than just throwing all of them away. For languages that cannot be transliterated to ASCII in a reasonable manner, more possible improvements are outlined in #194. --- ...6_02_04_095452_add_slug_to_discussions.php | 2 +- src/Discussion/Discussion.php | 2 +- src/Util/Str.php | 31 ------------------- 3 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 src/Util/Str.php diff --git a/migrations/2016_02_04_095452_add_slug_to_discussions.php b/migrations/2016_02_04_095452_add_slug_to_discussions.php index 21be8cc26..c34fdd17f 100644 --- a/migrations/2016_02_04_095452_add_slug_to_discussions.php +++ b/migrations/2016_02_04_095452_add_slug_to_discussions.php @@ -7,9 +7,9 @@ * LICENSE file that was distributed with this source code. */ -use Flarum\Util\Str; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; +use Illuminate\Support\Str; return [ 'up' => function (Builder $schema) { diff --git a/src/Discussion/Discussion.php b/src/Discussion/Discussion.php index 9db74c4a7..5d2ecb6ed 100644 --- a/src/Discussion/Discussion.php +++ b/src/Discussion/Discussion.php @@ -23,7 +23,7 @@ use Flarum\Notification\Notification; use Flarum\Post\MergeableInterface; use Flarum\Post\Post; use Flarum\User\User; -use Flarum\Util\Str; +use Illuminate\Support\Str; /** * @property int $id diff --git a/src/Util/Str.php b/src/Util/Str.php deleted file mode 100644 index e00a6d70e..000000000 --- a/src/Util/Str.php +++ /dev/null @@ -1,31 +0,0 @@ -