From: Alexander Ebert Date: Fri, 26 Aug 2016 10:02:11 +0000 (+0200) Subject: Automatically add missing protocol X-Git-Tag: 3.0.0_Beta_1~492 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7cdf9b3d7a09a726b0c7b88385265d0c35f1d88b;p=GitHub%2FWoltLab%2FWCF.git Automatically add missing protocol --- 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;