Merge "preferences: Prefer new kind of warnings about invalid HTML"

This commit is contained in:
jenkins-bot 2020-07-13 19:37:03 +00:00 committed by Gerrit Code Review
commit 5dbdd56871

View file

@ -1586,6 +1586,19 @@ class DefaultPreferencesFactory implements PreferencesFactory {
return true;
}
if ( $sigValidation === 'new' || $sigValidation === 'disallow' ) {
// Validate everything
$validator = new SignatureValidator(
$form->getUser(),
$form->getContext(),
ParserOptions::newFromContext( $form->getContext() )
);
$errors = $validator->validateSignature( $signature );
if ( $errors ) {
return $errors;
}
}
// Quick check for mismatched HTML tags in the input.
// Note that this is easily fooled by wikitext templates or bold/italic markup.
// We're only keeping this until Parsoid is integrated and guaranteed to be available.
@ -1594,15 +1607,6 @@ class DefaultPreferencesFactory implements PreferencesFactory {
return $form->msg( 'badsig' )->escaped();
}
if ( $sigValidation === 'new' || $sigValidation === 'disallow' ) {
// Validate everything
$validator = new SignatureValidator(
$form->getUser(),
$form->getContext(),
ParserOptions::newFromContext( $form->getContext() )
);
return $validator->validateSignature( $signature ) ?: true;
}
return true;
}