Input validation

  1. drupal
    1. 4.6 includes/common.inc
    2. 4.7 includes/common.inc
    3. 5 includes/common.inc
    4. 6 includes/common.inc
    5. 7 includes/common.inc
    6. 8 core/includes/common.inc

Functions to validate user input.

Functions & methods

NameDescription
base_pathReturns the base URL path of the Drupal installation. At the very least, this will always default to /.
check_file
check_urlPrepare a URL for use in an HTML attribute. Strips harmful protocols.
drupal_add_jsAdd a JavaScript file to the output.
drupal_add_linkAdd a <link> tag to the page's HEAD.
drupal_attributesFormat an attribute string to insert in a tag.
drupal_call_jsGenerates a Javascript call, while importing the arguments as is. PHP arrays are turned into JS objects to preserve keys. This means the array keys must conform to JS's member naming rules.
drupal_cloneProvide a substitute clone() function for PHP4.
drupal_evalEvaluate a string of PHP code.
drupal_get_pathReturns the path to a system item (module, theme, etc.).
drupal_get_private_keyEnsure the private key variable used to generate tokens is set.
drupal_get_tokenGenerate a token based on $value, the current user session and private key.
drupal_map_assocForm an associative array from a linear array.
drupal_page_footerPerform end-of-request tasks.
drupal_to_jsConverts a PHP variable into its Javascript equivalent.
drupal_urlencodeWrapper around urlencode() which avoids Apache quirks.
drupal_valid_tokenValidate a token based on $value, the current user session and private key.
flood_is_allowedCheck if the current visitor (hostname/IP) is allowed to proceed with the specified event. The user is allowed to proceed if he did not trigger the specified event more than $threshold times per hour.
flood_register_eventRegister an event for the current visitor (hostname/IP) to the flood control mechanism.
format_dateFormat a date with the given configured format or a custom format string.
format_intervalFormat a time interval with the requested granularity.
format_pluralFormat a string containing a count of items.
format_rss_channelFormats an RSS channel.
format_rss_itemFormat a single RSS item.
format_sizeGenerate a string representation for the given byte count.
format_xml_elementsFormat XML elements.
lFormat an internal Drupal link.
page_set_cacheStore the current page in the cache.
urlGenerate a URL from a Drupal menu path. Will also pass-through existing URLs.
valid_email_addressVerify the syntax of the given e-mail address.
valid_urlVerify the syntax of the given URL.
xmlrpcPerforms one or more XML-RPC request(s).
_drupal_bootstrap_full

Groups

NameDescription
FormattingFunctions to format numbers, strings, dates, etc.

File

includes/common.inc, line 635
Common functions that many Drupal modules will need to reference.

Login or register to post comments