MediaWiki master
HTMLSelectLimitField.php
Go to the documentation of this file.
1<?php
2
4
19 public function validate( $value, $alldata ) {
20 if ( $value == '' ) {
21 return true;
22 }
23
24 // Let folks pick an explicit limit not from our list, as long as it's a real number.
25 if ( !in_array( $value, $this->mParams['options'] )
26 && $value == intval( $value )
27 && $value > 0
28 ) {
29 // This adds the explicitly requested limit value to the drop-down,
30 // then makes sure it's sorted correctly so when we output the list
31 // later, the custom option doesn't just show up last.
32 $this->mParams['options'][$this->mParent->getLanguage()->formatNum( $value )] =
33 intval( $value );
34 asort( $this->mParams['options'] );
35 }
36
37 return true;
38 }
39}
40
42class_alias( HTMLSelectLimitField::class, 'HTMLSelectLimitField' );
A limit dropdown, which accepts any valid number.
validate( $value, $alldata)
Basically don't do any validation.