original_string: public function validate()
      {
          $result = parent::validate();
  
          //whitelist allowed URL schemes
          $allowed_schemes = array('http', 'https');
          if ($matches = parse_url($this->IFrameURL)) {
              if (isset($matches['scheme']) && !in_array($matches['scheme'], $allowed_schemes)) {
                  $result->addError(_t(__CLASS__ . '.VALIDATION_BANNEDURLSCHEME', "This URL scheme is not allowed."));
              }
          }
  
          return $result;
      }
code: public function validate()
      {
          $result = parent::validate();
  
          //whitelist allowed URL schemes
          $allowed_schemes = array('http', 'https');
          if ($matches = parse_url($this->IFrameURL)) {
              if (isset($matches['scheme']) && !in_array($matches['scheme'], $allowed_schemes)) {
                  $result->addError(_t(__CLASS__ . '.VALIDATION_BANNEDURLSCHEME', "This URL scheme is not allowed."));
              }
          }
  
          return $result;
      }
code_tokens: public function validate ( ) { $ result = parent :: validate ( ) ; //whitelist allowed URL schemes $ allowed_schemes = array ( 'http' , 'https' ) ; if ( $ matches = parse_url ( $ this -> IFrameURL ) ) { if ( isset ( $ matches [ 'scheme' ] ) && ! in_array ( $ matches [ 'scheme' ] , $ allowed_schemes ) ) { $ result -> addError ( _t ( __CLASS__ . '.VALIDATION_BANNEDURLSCHEME' , "This URL scheme is not allowed." ) ) ; } } return $ result ; }
docstring: Ensure that the IFrameURL is a valid url and prevents XSS
  
  @throws ValidationException
  @return ValidationResult
docstring_tokens: Ensure that the IFrameURL is a valid url and prevents XSS