diff options
author | C. Scott Ananian <cscott@cscott.net> | 2025-04-02 13:14:27 -0400 |
---|---|---|
committer | C. Scott Ananian <cscott@cscott.net> | 2025-04-02 13:16:05 -0400 |
commit | 87b9a124f0d8e2cf244cc9bb818f847649ad839a (patch) | |
tree | 3de4e4eb5d9242243d65d16d26dfd1941711b8a7 /includes/parser | |
parent | 5b03f143bc3091eb216cf034edb357bf8581e580 (diff) | |
download | mediawikicore-87b9a124f0d8e2cf244cc9bb818f847649ad839a.tar.gz mediawikicore-87b9a124f0d8e2cf244cc9bb818f847649ad839a.zip |
Parsoid SiteConfig: only perform schema validation when running tests
In Ib4c94eab0f3091d224c334b92fcb79215c519121 Parsoid gains a JSON
schema for its extension module configuration array. This patch
ensures that, for efficiency, we only validate against this schema
when running tests.
Follows-Up: Ib4c94eab0f3091d224c334b92fcb79215c519121
Change-Id: I5d81a7d95237bd749f8f4f8a98c62802dee298dd
Diffstat (limited to 'includes/parser')
-rw-r--r-- | includes/parser/Parsoid/Config/SiteConfig.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/parser/Parsoid/Config/SiteConfig.php b/includes/parser/Parsoid/Config/SiteConfig.php index 24a6eef635b4..4e91f19aa96d 100644 --- a/includes/parser/Parsoid/Config/SiteConfig.php +++ b/includes/parser/Parsoid/Config/SiteConfig.php @@ -749,6 +749,13 @@ class SiteConfig extends ISiteConfig { } /** @inheritDoc */ + protected function shouldValidateExtConfig(): bool { + // Only perform json schema validation for extension module + // configurations when running tests. + return defined( 'MW_PHPUNIT_TEST' ) || defined( 'MW_PARSER_TEST' ); + } + + /** @inheritDoc */ public function getMaxTemplateDepth(): int { return (int)$this->config->get( MainConfigNames::MaxTemplateDepth ); } |