ImportExportPlugin::isAllowedMethod PHP Method

isAllowedMethod() public method

Determine whether the specified URL describes an allowed protocol.
public isAllowedMethod ( $url ) : boolean
$url string
return boolean
    function isAllowedMethod($url)
    {
        $allowedPrefixes = array('http://', 'ftp://', 'https://', 'ftps://');
        foreach ($allowedPrefixes as $prefix) {
            if (substr($url, 0, strlen($prefix)) === $prefix) {
                return true;
            }
        }
        return false;
    }