Remove double encoded entities in title attribute
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 16 Jul 2010 16:50:15 +0000 (10:50 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 16 Jul 2010 16:50:36 +0000 (10:50 -0600)
framework/Core/lib/Horde.php

index 65e2a59..ee86ca3 100644 (file)
@@ -1162,7 +1162,11 @@ HTML;
                     htmlspecialchars(
                         nl2br(htmlspecialchars($title, ENT_QUOTES, $charset)),
                         ENT_QUOTES, $charset));
+
                 error_reporting($old_error);
+
+                /* Remove double encoded entities. */
+                $title = preg_replace('/&amp;([a-z]+|(#\d+));/i', '&\\1;', $title);
             }
             $attributes['title.raw'] = $title;
         }