original_string: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
          if ($data['issueremail'] && !validate_email($data['issueremail'])) {
              $errors['issueremail'] = get_string('invalidemail');
          }
          if ($data['issuerurl'] && !preg_match('@^https?://.+@', $data['issuerurl'])) {
              $errors['issuerurl'] = get_string('invalidurl', 'badges');
          }
          if ($data['claimid'] && !preg_match('@^https?://.+@', $data['claimid'])) {
              $errors['claimid'] = get_string('invalidurl', 'badges');
          }
          return $errors;
      }
code: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
          if ($data['issueremail'] && !validate_email($data['issueremail'])) {
              $errors['issueremail'] = get_string('invalidemail');
          }
          if ($data['issuerurl'] && !preg_match('@^https?://.+@', $data['issuerurl'])) {
              $errors['issuerurl'] = get_string('invalidurl', 'badges');
          }
          if ($data['claimid'] && !preg_match('@^https?://.+@', $data['claimid'])) {
              $errors['claimid'] = get_string('invalidurl', 'badges');
          }
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( $ data [ 'issueremail' ] && ! validate_email ( $ data [ 'issueremail' ] ) ) { $ errors [ 'issueremail' ] = get_string ( 'invalidemail' ) ; } if ( $ data [ 'issuerurl' ] && ! preg_match ( '@^https?://.+@' , $ data [ 'issuerurl' ] ) ) { $ errors [ 'issuerurl' ] = get_string ( 'invalidurl' , 'badges' ) ; } if ( $ data [ 'claimid' ] && ! preg_match ( '@^https?://.+@' , $ data [ 'claimid' ] ) ) { $ errors [ 'claimid' ] = get_string ( 'invalidurl' , 'badges' ) ; } return $ errors ; }
docstring: Validates form data.
  
  @param array $data submitted data.
  @param array $files submitted files.
  @return array $errors An array of errors.
docstring_tokens: Validates form data .