url_is_external
- Versions
- 7
url_is_external($path)
Return TRUE if a path is external (e.g. http://example.com).
Code
includes/common.inc, line 2601
<?php
function url_is_external($path) {
$colonpos = strpos($path, ':');
// Only call the slow filter_xss_bad_protocol if $path contains a ':'
// before any / ? or #.
return $colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path);
}
?>Login or register to post comments 