From cdafb218fac26a460e54d79e8f23fa4910351d98 Mon Sep 17 00:00:00 2001 From: Crisciany Souza Date: Wed, 9 Oct 2024 14:14:02 -0400 Subject: [PATCH] fix:adjustment regex helpers/current_path_locale Signed-off-by: Crisciany Souza --- src/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index 9e7bcf3..c917363 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -29,12 +29,12 @@ function current_path_locale($page): string $path = trim($page->getPath(), '/'); /** - * - [a-z]{2,3} language code + * - [a-z]{2} language code * - [A-Z]{2} region code * * @var string $locale_regex */ - $locale_regex = '/^(?(?:[a-z]{2,3}-[A-Z]{2})|(?:[a-z]{2,3}))(?:[^a-zA-Z]|$)/'; + $locale_regex = '/^(?(?:[a-z]{2}-[A-Z]{2})|(?:[a-z]{2}))(?:[^a-zA-Z]|$)/'; preg_match($locale_regex, $path, $matches);