* Only build the HTML attribute whitelist tree once.

This commit is contained in:
Brion Vibber 2005-05-31 10:21:14 +00:00
parent 72872bbfb7
commit 63ceedb8d4
2 changed files with 6 additions and 1 deletions

View file

@ -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 ===

View file

@ -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();