* @param WebRequest $request
* @return string|MWRestrictions Restrictions object or original string if invalid
*/
* @param WebRequest $request
* @return string|MWRestrictions Restrictions object or original string if invalid
*/
* @param string|MWRestrictions $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
* @param string|MWRestrictions $value The value the field was submitted with
* @param array $alldata The data collected from the form
*
* false to fail validation without displaying an error.
*/
public function validate( $value, $alldata ) {
* false to fail validation without displaying an error.
*/
public function validate( $value, $alldata ) {
isset( $this->mParams['required'] ) && $this->mParams['required'] !== false
&& $value instanceof MWRestrictions && !$value->toArray()['IPAddresses']
) {
isset( $this->mParams['required'] ) && $this->mParams['required'] !== false
&& $value instanceof MWRestrictions && !$value->toArray()['IPAddresses']
) {