From ca0e1a0ff0bee1d600eb6083144b5a43b7c28095 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Wed, 15 Dec 2010 20:10:16 +0000 Subject: [PATCH] Follow-up r78445: validation errors would never be shown on a GET form --- includes/HTMLForm.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index cd3dc1ff3d..d1a5438ff5 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -595,6 +595,10 @@ class HTMLForm { public function setMethod( $method='post' ){ $this->mMethod = $method; } + + public function getMethod(){ + return $this->mMethod; + } /** * TODO: Document @@ -850,7 +854,7 @@ abstract class HTMLFormField { $verticalLabel = true; } - if ( $errors === true || !$wgRequest->wasPosted() ) { + if ( $errors === true || ( !$wgRequest->wasPosted() && ( $this->mParent->getMethod() == 'post' ) ) ) { $errors = ''; } else { $errors = Html::rawElement( 'span', array( 'class' => 'error' ), $errors ); -- 2.20.1