From 63ceedb8d4ee8014a6097c6dd22aa2d6dfd88807 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 31 May 2005 10:21:14 +0000 Subject: [PATCH] * Only build the HTML attribute whitelist tree once. --- RELEASE-NOTES | 2 ++ includes/Sanitizer.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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(); -- 2.20.1