Follow-up r77640: Check whether there are errors before asking Status to transform...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Wed, 2 Feb 2011 15:44:42 +0000 (15:44 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Wed, 2 Feb 2011 15:44:42 +0000 (15:44 +0000)
includes/HTMLForm.php

index 8e3301d..2472bc2 100644 (file)
@@ -509,7 +509,11 @@ class HTMLForm {
        function getErrors( $errors ) {
                if ( $errors instanceof Status ) {
                        global $wgOut;
-                       $errorstr = $wgOut->parse( $errors->getWikiText() );
+                       if ( $errors->isOK() ) {
+                               $errorstr = '';
+                       } else {
+                               $errorstr = $wgOut->parse( $errors->getWikiText() );
+                       }
                } elseif ( is_array( $errors ) ) {
                        $errorstr = $this->formatErrors( $errors );
                } else {