* Only build the HTML attribute whitelist tree once.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 31 May 2005 10:21:14 +0000 (10:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 31 May 2005 10:21:14 +0000 (10:21 +0000)
RELEASE-NOTES
includes/Sanitizer.php

index bbbb56a..b9d3449 100644 (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 ===
 
index 116a803..449ca5c 100644 (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();