From 9c70df0cf6c2625ba6650a743a7c9da7e808cfb4 Mon Sep 17 00:00:00 2001 From: stang Date: Fri, 4 Mar 2022 21:40:26 +0000 Subject: Fix uses of (error|warning|success)box in core Replace HTML class for boxes with "mw-message-box-" style. Bug: T300358 Change-Id: Iddb0fd3ae859714fb03d3a6d4586f8525becaac6 --- includes/htmlform/HTMLForm.php | 10 +++++++--- includes/htmlform/HTMLFormField.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'includes/htmlform') diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index d0eb5fc45646..368097318e2e 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -1515,9 +1515,13 @@ class HTMLForm extends ContextSource { } } - return $elementstr - ? Html::rawElement( 'div', [ 'class' => $elementsType . 'box' ], $elementstr ) - : ''; + if ( !$elementstr ) { + return ''; + } elseif ( $elementsType === 'error' ) { + return Html::errorBox( $elementstr ); + } else { // $elementsType can only be 'warning' + return Html::warningBox( $elementstr ); + } } /** diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 2e2382b4b892..75dbafa555cd 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -1293,7 +1293,7 @@ abstract class HTMLFormField { } } - return Html::rawElement( 'div', [ 'class' => 'errorbox' ], $errors ); + return Html::errorBox( $errors ); } /** -- cgit v1.2.3