Add CollationFa
[lhc/web/wiklou.git] / includes / htmlform / HTMLFloatField.php
index 817d9c5..2ef4978 100644 (file)
@@ -1,10 +1,11 @@
 <?php
+
 /**
  * A field that will contain a numeric value
  */
 class HTMLFloatField extends HTMLTextField {
        function getSize() {
-               return isset( $this->mParams[ 'size' ] ) ? $this->mParams[ 'size' ] : 20;
+               return isset( $this->mParams['size'] ) ? $this->mParams['size'] : 20;
        }
 
        function validate( $value, $alldata ) {
@@ -16,24 +17,24 @@ class HTMLFloatField extends HTMLTextField {
 
                $value = trim( $value );
 
-               # http://dev.w3.org/html5/spec/common-microsyntaxes.html#real-numbers
+               # http://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers
                # with the addition that a leading '+' sign is ok.
-               if ( ! preg_match( '/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) {
+               if ( !preg_match( '/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) {
                        return $this->msg( 'htmlform-float-invalid' )->parseAsBlock();
                }
 
                # The "int" part of these message names is rather confusing.
                # They make equal sense for all numbers.
-               if ( isset( $this->mParams[ 'min' ] ) ) {
-                       $min = $this->mParams[ 'min' ];
+               if ( isset( $this->mParams['min'] ) ) {
+                       $min = $this->mParams['min'];
 
                        if ( $min > $value ) {
                                return $this->msg( 'htmlform-int-toolow', $min )->parseAsBlock();
                        }
                }
 
-               if ( isset( $this->mParams[ 'max' ] ) ) {
-                       $max = $this->mParams[ 'max' ];
+               if ( isset( $this->mParams['max'] ) ) {
+                       $max = $this->mParams['max'];
 
                        if ( $max < $value ) {
                                return $this->msg( 'htmlform-int-toohigh', $max )->parseAsBlock();
@@ -42,4 +43,4 @@ class HTMLFloatField extends HTMLTextField {
 
                return true;
        }
-}
\ No newline at end of file
+}