示例#1
0
/**
* Sanitize a URL
*
* @param    string  $url                URL to sanitized
* @param    array   $allowed_protocols  array of allowed protocols
* @param    string  $default_protocol   replacement protocol (default: http)
* @return   string                      sanitized URL
*
*/
function COM_sanitizeUrl($url, $allowed_protocols = array('http', 'https', 'ftp'), $default_protocol = 'http')
{
    $filter = new sanitizer();
    return $filter->sanitizeUrl($url, $allowed_protocols = array('http', 'https', 'ftp'), $default_protocol = 'http');
}