X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFloatField.php;h=3b38fbe89268dc375891e21507aa21986e7b1afc;hb=c1bf30c2e55a7bae04b3c5e232f5017ed79bbd80;hp=817d9c51e625d629d3354942ead2476734c206a2;hpb=57d3f41876599497fcb9c672b88ebad7239353dc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFloatField.php b/includes/htmlform/HTMLFloatField.php index 817d9c51e6..3b38fbe892 100644 --- a/includes/htmlform/HTMLFloatField.php +++ b/includes/htmlform/HTMLFloatField.php @@ -1,10 +1,11 @@ mParams[ 'size' ] ) ? $this->mParams[ 'size' ] : 20; + return isset( $this->mParams['size'] ) ? $this->mParams['size'] : 20; } function validate( $value, $alldata ) { @@ -18,22 +19,22 @@ class HTMLFloatField extends HTMLTextField { # http://dev.w3.org/html5/spec/common-microsyntaxes.html#real-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 +}