diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-30 12:53:51 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-30 12:53:51 -0700 |
commit | 0c92275fbeb9d0170a0ee3626cedb7fc328687e5 (patch) | |
tree | cc4e1af78b00ff5b60693ab859a87205fa9c9a4c /includes | |
parent | dbc2d7c27c54fc68503e9dbfa9b79fe5a271298e (diff) | |
download | brdo-0c92275fbeb9d0170a0ee3626cedb7fc328687e5.tar.gz brdo-0c92275fbeb9d0170a0ee3626cedb7fc328687e5.tar.bz2 |
Issue #1113702 by franz: Fixed Comment in url_is_external() wrong.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index ba0b6fffe..3b32a2083 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2196,8 +2196,9 @@ function url($path = NULL, array $options = array()) { */ function url_is_external($path) { $colonpos = strpos($path, ':'); - // Only call the slow drupal_strip_dangerous_protocols() if $path contains a - // ':' before any / ? or #. + // Avoid calling drupal_strip_dangerous_protocols() if there is any + // slash (/), hash (#) or question_mark (?) before the colon (:) + // occurrence - if any - as this would clearly mean it is not a URL. return $colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && drupal_strip_dangerous_protocols($path) == $path; } |