Fixed URL parsing issue
authorMarcel Werk <burntime@woltlab.com>
Sat, 11 Jan 2014 21:28:09 +0000 (22:28 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sat, 11 Jan 2014 21:28:09 +0000 (22:28 +0100)
wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php

index 9afaba670cb3a6a19766fa827be2415ada7af49e..4cde4ebef8130b7ea94c66dd6b1e3fe69f91e5a1 100644 (file)
@@ -150,7 +150,14 @@ class SimpleMessageParser extends SingletonFactory {
         * @see \wcf\system\bbcode\SimpleMessageParser::parseURLs()
         */
        protected function parseURLsCallback($matches) {
-               return StringUtil::getAnchorTag(StringUtil::decodeHTML($matches[0]));
+               $url = StringUtil::decodeHTML($matches[0]);
+               
+               // add protocol if necessary
+               if (!preg_match("/[a-z]:\/\//si", $url)) {
+                       $url = 'http://'.$url;
+               }
+               
+               return StringUtil::getAnchorTag($url);
        }
        
        /**