fixing a problem regarding the activation of links encoded with htmlspecialchars

This commit is contained in:
Klaus Leithoff 2009-11-05 08:40:57 +00:00
parent 1fac8112a9
commit 5a4f03cf7b

View File

@ -143,7 +143,9 @@ class html
static function activate_links($content)
{
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
$NotAnchor = '(?<!"|href=|href\s=\s|href=\s|href\s=)';