72 public function validate( $name, $value, array $settings, array $options ) {
73 if ( !preg_match(
'/^[+-]?\d+$/D', $value ) ) {
76 $ret = intval( $value, 10 );
79 if ( $ret === PHP_INT_MAX || $ret === PHP_INT_MIN ) {
80 $tmp = ( $ret < 0 ?
'-' :
'' ) . ltrim( $value,
'-0' );
81 if ( $tmp !== (
string)$ret ) {
91 if ( $min !==
null && $ret < $min ) {
92 $err =
'belowminimum';
94 } elseif ( $max !==
null && $ret > $max ) {
95 if ( $max2 !==
null && $this->callbacks->useHighLimits( $options ) ) {
97 $err =
'abovehighmaximum';
101 $err =
'abovemaximum';
105 if ( $err !==
null ) {
107 'min' => $min ===
null ?
'' : $min,
108 'max' => $max ===
null ?
'' : $max,
109 'max2' => $max2 ===
null ?
'' : $max2,
111 if ( empty( $settings[self::PARAM_IGNORE_RANGE] ) ) {
114 $this->callbacks->recordCondition( $ex, $options );