diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Markup/Renderer/Html/Url.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Markup/Renderer/Html/Url.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,77 @@ +hasAttribute('url')) { + $uri = $token->getAttribute('url'); + } else { + $uri = $text; + } + + if (!preg_match('/^([a-z][a-z+\-.]*):/i', $uri)) { + $uri = 'http://' . $uri; + } + + // check if the URL is valid + if (!Zend_Markup_Renderer_Html::isValidUri($uri)) { + return $text; + } + + $attributes = Zend_Markup_Renderer_Html::renderAttributes($token); + + // run the URI through htmlentities + $uri = htmlentities($uri, ENT_QUOTES, Zend_Markup_Renderer_Html::getEncoding()); + + return "{$text}"; + } + +}