From 208081b5609d1d70a4a709f13dd12b5092b787a2 Mon Sep 17 00:00:00 2001 From: Alexey Khozyaykin Date: Mon, 25 Nov 2024 09:22:45 +0300 Subject: [PATCH 1/4] safe url --- src/SafeBlock.php | 1 + tests/TypografTest.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/SafeBlock.php b/src/SafeBlock.php index a62497c..7279035 100644 --- a/src/SafeBlock.php +++ b/src/SafeBlock.php @@ -27,6 +27,7 @@ class SafeBlock '//ius', '/\[[a-z]([^]]+)]/ius', '/(.+?)<\/span>/ius', + '/https?:\/\/?([^<\'"[\s]+)/ius', ]; /** diff --git a/tests/TypografTest.php b/tests/TypografTest.php index cf0a373..e80ab11 100644 --- a/tests/TypografTest.php +++ b/tests/TypografTest.php @@ -143,6 +143,9 @@ public function testApplyDocument(): void

"Пример"

+ https://www.domain.com/path/test-05-09-2024/ + https://domain.com/path/test-05-09-2024/ + [embed]https://domain.com/path/test-05-09-2024/[/embed]