diff --git a/src/EntryPoints/MediaWikiHooks.php b/src/EntryPoints/MediaWikiHooks.php index 45c440b..cddfb72 100644 --- a/src/EntryPoints/MediaWikiHooks.php +++ b/src/EntryPoints/MediaWikiHooks.php @@ -22,12 +22,13 @@ public static function onContentHandlerDefaultModelFor( Title $title, ?string &$ } public static function onEditFilter( EditPage $editPage, ?string $text, ?string $section, string &$error ): void { + if ( !is_string( $text ) || !WikibaseExportExtension::getInstance()->isConfigTitle( $editPage->getTitle() ) ) { + return; + } + $validator = ConfigJsonValidator::newInstance(); - if ( is_string( $text ) - && WikibaseExportExtension::getInstance()->isConfigTitle( $editPage->getTitle() ) - && !$validator->validate( $text ) - ) { + if ( !$validator->validate( $text ) ) { $errors = $validator->getErrors(); $error = \Html::errorBox( wfMessage( 'wikibase-export-config-invalid', count( $errors ) )->escaped() .