Merge "Improve hidden field validation"
[lhc/web/wiklou.git] / includes / htmlform / HTMLFormField.php
index 7e4b15b..4cf2394 100644 (file)
@@ -113,7 +113,7 @@ abstract class HTMLFormField {
                                }
                                $data = $data[$key];
                        }
-                       $testValue = $data;
+                       $testValue = (string)$data;
                        break;
                }
 
@@ -593,6 +593,9 @@ abstract class HTMLFormField {
                $wrapperAttributes = array(
                        'class' => 'htmlform-tip',
                );
+               if ( $this->mHelpClass !== false ) {
+                       $wrapperAttributes['class'] .= " {$this->mHelpClass}";
+               }
                if ( $this->mHideIf ) {
                        $wrapperAttributes['data-hide-if'] = FormatJson::encode( $this->mHideIf );
                        $wrapperAttributes['class'] .= ' mw-htmlform-hide-if';