revert of the change in r28264 as it would allow crossside scripting

This commit is contained in:
Klaus Leithoff 2009-11-05 09:06:41 +00:00
parent 5a4f03cf7b
commit e99af0dfd6

View File

@ -143,9 +143,7 @@ class html
static function activate_links($content) static function activate_links($content)
{ {
if (!$content || strlen($content) < 20) return $content; // performance if (!$content || strlen($content) < 20) return $content; // performance
// this seems to be needed as the preg_replace to match things beginning with http:// (or other protocols)
// seems to be throwing out &amp; and leaving &; - which is breaking links.
$content = htmlspecialchars_decode($content);
// Exclude everything which is already a link // Exclude everything which is already a link
$NotAnchor = '(?<!"|href=|href\s=\s|href=\s|href\s=)'; $NotAnchor = '(?<!"|href=|href\s=\s|href=\s|href\s=)';