From 7cdf9b3d7a09a726b0c7b88385265d0c35f1d88b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 26 Aug 2016 12:02:11 +0200 Subject: [PATCH] Automatically add missing protocol --- .../system/html/input/node/HtmlInputNodeTextParser.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php index 4d6102ab3c..2e75b09faf 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php @@ -364,6 +364,9 @@ class HtmlInputNodeTextParser { } else { if ($allowURL) { + // add protocol if necessary + if (!preg_match('/[a-z]:\/\//si', $link)) $link = 'http://'.$link; + $element = $text->ownerDocument->createElement('a'); $element->setAttribute('href', $link); $element->textContent = $link; -- 2.20.1