diff --git a/app/Helpers/misc_helper.php b/app/Helpers/misc_helper.php index f988de62..99a7a75b 100644 --- a/app/Helpers/misc_helper.php +++ b/app/Helpers/misc_helper.php @@ -23,7 +23,7 @@ if (! function_exists('get_browser_language')) { } if (! function_exists('slugify')) { - function slugify(string $text, int $maxLength = 191): string + function slugify(string $text, int $maxLength = 128): string { // trim text to the nearest whole word if too long if (strlen($text) > $maxLength) { diff --git a/app/Models/EpisodeModel.php b/app/Models/EpisodeModel.php index b5a9c8d1..44ec3b26 100644 --- a/app/Models/EpisodeModel.php +++ b/app/Models/EpisodeModel.php @@ -108,7 +108,7 @@ class EpisodeModel extends Model protected $validationRules = [ 'podcast_id' => 'required', 'title' => 'required', - 'slug' => 'required|regex_match[/^[a-zA-Z0-9\-]{1,191}$/]', + 'slug' => 'required|regex_match[/^[a-zA-Z0-9\-]{1,128}$/]', 'audio_id' => 'required', 'description_markdown' => 'required', 'number' => 'is_natural_no_zero|permit_empty', diff --git a/app/Models/PageModel.php b/app/Models/PageModel.php index 1b3b6284..49726c7f 100644 --- a/app/Models/PageModel.php +++ b/app/Models/PageModel.php @@ -51,7 +51,7 @@ class PageModel extends Model protected $validationRules = [ 'title' => 'required', 'slug' => - 'required|regex_match[/^[a-zA-Z0-9\-]{1,191}$/]|is_unique[pages.slug,id,{id}]', + 'required|regex_match[/^[a-zA-Z0-9\-]{1,128}$/]|is_unique[pages.slug,id,{id}]', 'content_markdown' => 'required', ]; diff --git a/modules/Admin/Controllers/PodcastImportController.php b/modules/Admin/Controllers/PodcastImportController.php index a74296ea..a24af7fc 100644 --- a/modules/Admin/Controllers/PodcastImportController.php +++ b/modules/Admin/Controllers/PodcastImportController.php @@ -306,7 +306,7 @@ class PodcastImportController extends BaseController $textToSlugify = $this->request->getPost('slug_field') === 'title' ? (string) $item->title : basename((string) $item->link); - $slug = slugify($textToSlugify, 185); + $slug = slugify($textToSlugify, 120); if (in_array($slug, $slugs, true)) { $slugNumber = 2; while (in_array($slug . '-' . $slugNumber, $slugs, true)) { diff --git a/modules/Analytics/Database/Migrations/2017-12-01-170000_add_analytics_website_by_browser.php b/modules/Analytics/Database/Migrations/2017-12-01-170000_add_analytics_website_by_browser.php index e6901ad5..72fd99b0 100644 --- a/modules/Analytics/Database/Migrations/2017-12-01-170000_add_analytics_website_by_browser.php +++ b/modules/Analytics/Database/Migrations/2017-12-01-170000_add_analytics_website_by_browser.php @@ -28,7 +28,7 @@ class AddAnalyticsWebsiteByBrowser extends Migration ], 'browser' => [ 'type' => 'VARCHAR', - 'constraint' => 191, + 'constraint' => 128, ], 'hits' => [ 'type' => 'INT', diff --git a/modules/Analytics/Database/Migrations/2017-12-01-200000_add_analytics_unknown_useragents.php b/modules/Analytics/Database/Migrations/2017-12-01-200000_add_analytics_unknown_useragents.php index 927b5783..3c6bb27b 100644 --- a/modules/Analytics/Database/Migrations/2017-12-01-200000_add_analytics_unknown_useragents.php +++ b/modules/Analytics/Database/Migrations/2017-12-01-200000_add_analytics_unknown_useragents.php @@ -26,7 +26,7 @@ class AddAnalyticsUnknownUseragents extends Migration ], 'useragent' => [ 'type' => 'VARCHAR', - 'constraint' => 191, + 'constraint' => 255, 'unique' => true, ], 'hits' => [