From: Brion Vibber Date: Tue, 31 May 2005 10:21:14 +0000 (+0000) Subject: * Only build the HTML attribute whitelist tree once. X-Git-Tag: 1.5.0alpha2~22 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=63ceedb8d4ee8014a6097c6dd22aa2d6dfd88807;p=lhc%2Fweb%2Fwiklou.git * Only build the HTML attribute whitelist tree once. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bbbb56aa7a..b9d3449aff 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -227,6 +227,8 @@ Various bugfixes, small features, and a few experimental things: * Remove linkscc table code, no longer used. * (bug 2271) Use faster text-only link replacement in image alt text instead of rerunning expensive link lookup and HTML generation. +* Only build the HTML attribute whitelist tree once. + === Caveats === diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 116a803611..449ca5c81a 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -663,7 +663,10 @@ class Sanitizer { * @return array */ function attributeWhitelist( $element ) { - $list = Sanitizer::setupAttributeWhitelist(); + static $list; + if( !isset( $list ) ) { + $list = Sanitizer::setupAttributeWhitelist(); + } return isset( $list[$element] ) ? $list[$element] : array();