From ab0c6342c3e5419a37e19b44055e14f9656d707c Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:25:16 +0300 Subject: [PATCH] Improved TLDs interface Also fixed IDN table export issue --- cp/app/Controllers/SystemController.php | 5 +++++ cp/resources/views/admin/system/listTlds.twig | 14 ++++++++++++++ cp/resources/views/partials/js-tlds.twig | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cp/app/Controllers/SystemController.php b/cp/app/Controllers/SystemController.php index a734a29..2045a83 100644 --- a/cp/app/Controllers/SystemController.php +++ b/cp/app/Controllers/SystemController.php @@ -1749,6 +1749,11 @@ class SystemController extends Controller $idn_table = $db->selectValue('SELECT idn_table FROM domain_tld WHERE tld = ?', [ $args ]); + if (!$idn_table) { + $this->container->get('flash')->addMessage('error', 'TLD does not exist'); + return $response->withHeader('Location', '/registry/tlds')->withStatus(302); + } + $idn_table_map = [ '/^(?!-)(?!.*--)[A-Z0-9-]{1,63}(? 'ascii', '/^[а-яА-ЯґҐєЄіІїЇѝЍћЋљЈ0-9ʼѫѣѭ]+$/u' => 'cyrillic', diff --git a/cp/resources/views/admin/system/listTlds.twig b/cp/resources/views/admin/system/listTlds.twig index dac3906..c58e7a8 100644 --- a/cp/resources/views/admin/system/listTlds.twig +++ b/cp/resources/views/admin/system/listTlds.twig @@ -20,6 +20,20 @@