From f46fba34eb8ec206eee001e1a3745b438a6f1542 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 25 Mar 2024 16:49:58 -0700 Subject: HTMLForm: Make raw InfoFields work in Codex HTMLInfoField overrides getDiv(), getTableRow() and getOOUI() to output the raw value if 'rawrow' is set. Override getCodex() too, so that 'rawrow' also works correctly in CodexHTMLForm. This caused a bug where going to Special:UserLogin?warning=mobile-frontend-watchlist-purpose would show a message box that was incorrectly wrapped in a cdx-field div. That seems to have been harmless, but it's incorrect behavior and could cause styling bugs in the future. Change-Id: I1fd4e2e53f9e03561fe300b6924e44cf222db3c9 --- includes/htmlform/fields/HTMLInfoField.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'includes/htmlform/fields') diff --git a/includes/htmlform/fields/HTMLInfoField.php b/includes/htmlform/fields/HTMLInfoField.php index 813ba6c2dc1d..cedf2edcb23b 100644 --- a/includes/htmlform/fields/HTMLInfoField.php +++ b/includes/htmlform/fields/HTMLInfoField.php @@ -121,6 +121,14 @@ class HTMLInfoField extends HTMLFormField { return parent::getOOUI( $value ); } + public function getCodex( $value ) { + if ( !empty( $this->mParams['rawrow'] ) ) { + return $value; + } + + return parent::getCodex( $value ); + } + /** * @inheritDoc * @stable to override -- cgit v1.2.3