original_string: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if (!array_key_exists('setting_root_filename', $errors)) {
              if (trim($data['setting_root_filename']) == '') {
                  $errors['setting_root_filename'] = get_string('errorfilenamerequired', 'backup');
              } else if (strlen(trim($data['setting_root_filename'])) > 255) {
                  $errors['setting_root_filename'] = get_string('errorfilenametoolong', 'backup');
              } else if (!preg_match('#\.mbz$#i', $data['setting_root_filename'])) {
                  $errors['setting_root_filename'] = get_string('errorfilenamemustbezip', 'backup');
              }
          }
  
          return $errors;
      }
code: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if (!array_key_exists('setting_root_filename', $errors)) {
              if (trim($data['setting_root_filename']) == '') {
                  $errors['setting_root_filename'] = get_string('errorfilenamerequired', 'backup');
              } else if (strlen(trim($data['setting_root_filename'])) > 255) {
                  $errors['setting_root_filename'] = get_string('errorfilenametoolong', 'backup');
              } else if (!preg_match('#\.mbz$#i', $data['setting_root_filename'])) {
                  $errors['setting_root_filename'] = get_string('errorfilenamemustbezip', 'backup');
              }
          }
  
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( ! array_key_exists ( 'setting_root_filename' , $ errors ) ) { if ( trim ( $ data [ 'setting_root_filename' ] ) == '' ) { $ errors [ 'setting_root_filename' ] = get_string ( 'errorfilenamerequired' , 'backup' ) ; } else if ( strlen ( trim ( $ data [ 'setting_root_filename' ] ) ) > 255 ) { $ errors [ 'setting_root_filename' ] = get_string ( 'errorfilenametoolong' , 'backup' ) ; } else if ( ! preg_match ( '#\.mbz$#i' , $ data [ 'setting_root_filename' ] ) ) { $ errors [ 'setting_root_filename' ] = get_string ( 'errorfilenamemustbezip' , 'backup' ) ; } } return $ errors ; }
docstring: Validates the form.
  
  Relies on the parent::validation for the bulk of the work.
  
  @param array $data
  @param array $files
  @return array
  @throws coding_exception
docstring_tokens: Validates the form .