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;
    }
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;
    }
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 ; }
Ensure that the IFrameURL is a valid url and prevents XSS

@throws ValidationException
@return ValidationResult
Ensure that the IFrameURL is a valid url and prevents XSS