You are here

function _link_domains in Link 7

Same name and namespace in other branches
  1. 6.2 link.module \_link_domains()

Returns the list of allowed domains.

If the variable link_allowed_domains is set, restrict allowed domains to the strings in that array. If the variable link_allowed_domains is not set, allow all domains between 2 and 63 characters in length. See https://tools.ietf.org/html/rfc1034.

3 calls to _link_domains()
link_cleanup_url in ./link.module
Forms a valid URL if possible from an entered address.
link_url_type in ./link.module
Type check a URL.
link_views_handler_filter_protocol::op_protocol in views/link_views_handler_filter_protocol.inc
Filter down the query to include only the selected protocols.

File

./link.module, line 1875
Defines simple link field types.

Code

function _link_domains() {
  $link_allowed_domains = variable_get('link_allowed_domains', array());
  return empty($link_allowed_domains) ? '[a-z][a-z0-9-]{1,62}' : implode('|', $link_allowed_domains);
}