Allow veaction=edit only when content type supports visualeditor

The content type check gets lost by refactor of the condition in
3458d8a27e for veaction=edit.
That seems wrong as the comment says only with supported content model

Follow-Up: Ie174bc3f16bceb29cb155b9223e0acef70167fd6
Change-Id: I088f358efaa0a00a2bacbf371c80607231c79eb7
This commit is contained in:
Umherirrender 2024-03-23 01:22:17 +01:00
parent 8e3dcce2d6
commit b5359f08cf

View file

@ -357,13 +357,13 @@ class Hooks implements
return (
// If forced by the URL parameter, skip the namespace check (T221892) and preference check
$req->getVal( 'veaction' ) === 'edit' || (
( $req->getVal( 'veaction' ) === 'edit' || (
// Only in enabled namespaces
ApiVisualEditor::isAllowedNamespace( $veConfig, $title->getNamespace() ) &&
// Enabled per user preferences
self::enabledForUser( $user )
) &&
) ) &&
// Only for pages with a supported content model
ApiVisualEditor::isAllowedContentType( $veConfig, $title->getContentModel() )
);