* Only build the HTML attribute whitelist tree once.
This commit is contained in:
parent
72872bbfb7
commit
63ceedb8d4
2 changed files with 6 additions and 1 deletions
|
|
@ -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 ===
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue