25 public function validate( $name, $value, array $settings, array $options ) {
26 if ( !preg_match(
'/^[+-]?\d+$/D', $value ) ) {
27 $this->
failure(
'badinteger', $name, $value, $settings, $options );
29 $ret = intval( $value, 10 );
32 if ( $ret === PHP_INT_MAX || $ret === PHP_INT_MIN ) {
33 $tmp = ( $ret < 0 ?
'-' :
'' ) . ltrim( $value,
'-0' );
34 if ( $tmp !== (
string)$ret ) {
35 $this->
failure(
'badinteger', $name, $value, $settings, $options );
39 return $this->
checkRange( $ret, $name, $value, $settings, $options );