Ensure that the recognizedTagData static cache is properly initialized

This fixes a bug introduced inadvertently in
9f14fbd002 when the static cache for
Sanitizer::getRecognizedTagData() was refactored to reduce setup
overhead.

Bug: T303360
Change-Id: I606eeda1fcdbb6d4c62e2dc8db5b6e1659ae3f3f
This commit is contained in:
C. Scott Ananian 2022-03-08 19:13:52 -05:00
parent 37d5919e60
commit d5cddb0c24

View file

@ -153,7 +153,7 @@ class Sanitizer {
global $wgAllowImageTag;
static $commonCase, $staticInitialised;
$isCommonCase = ( $extratags === [] && $removetags === [] );
if ( $staticInitialised === $wgAllowImageTag && $isCommonCase ) {
if ( $staticInitialised === $wgAllowImageTag && $isCommonCase && $commonCase ) {
return $commonCase;
}