From eb6516549cae523a43be6a1e5f3804f4e3676a13 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 17 Sep 2023 02:05:14 +0300 Subject: [PATCH] trim line separators as URL validation fails --- src/public/edit.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/public/edit.php b/src/public/edit.php index fa35db5..dab652f 100644 --- a/src/public/edit.php +++ b/src/public/edit.php @@ -353,6 +353,8 @@ else { { foreach (explode(PHP_EOL, str_replace(['#', ',', ' '], PHP_EOL, $_POST['kt'])) as $kt) { + $kt = trim($kt); + if (!empty(trim($kt))) { $db->initMagnetToKeywordTopicId( @@ -373,6 +375,8 @@ else { foreach (explode(PHP_EOL, str_replace(['#', ',', ' '], PHP_EOL, $_POST['tr'])) as $tr) { + $tr = trim($tr); + if (Valid::url($tr)) { if ($url = Yggverse\Parser\Url::parse($tr)) @@ -404,6 +408,8 @@ else { foreach (explode(PHP_EOL, str_replace(['#', ',', ' '], PHP_EOL, $_POST['as'])) as $as) { + $xs = trim($as); + if (Valid::url($as)) { if ($url = Yggverse\Parser\Url::parse($as)) @@ -435,6 +441,8 @@ else { foreach (explode(PHP_EOL, str_replace(['#', ',', ' '], PHP_EOL, $_POST['xs'])) as $xs) { + $xs = trim($xs); + if (Valid::url($xs)) { if ($url = Yggverse\Parser\Url::parse($xs))