Hooks: Remove use of unsafe inDebugMode() from handleTag()

The handleTag() method is used for parsing `<templatestyles>` in
wikitext. The result of that should not vary by unregistered variables
such as ResourceLoader's `debug` parameter, or user cookies, which
seem likely to cause cache poisoning.

Bug: T36738
Change-Id: I85ab7bc694858bc8e7fe2f3cc79197ff4f2d1c38
This commit is contained in:
Timo Tijhof 2022-07-26 19:46:50 -07:00 committed by Krinkle
parent 1c1213dd6d
commit 994cf917ec

View file

@ -18,7 +18,6 @@ use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
use Parser;
use PPFrame;
use ResourceLoader;
use Title;
use Wikimedia\CSS\Grammar\CheckedMatcher;
use Wikimedia\CSS\Grammar\GrammarMatch;
@ -357,7 +356,7 @@ class Hooks {
$content,
[
'flip' => $targetDir !== $contentDir,
'minify' => !ResourceLoader::inDebugMode(),
'minify' => true,
'class' => $wrapClass,
'extraWrapper' => $extraWrapper,
]