Input validation

Functions to validate user input.

Functions

NameLocationDescription
base_pathincludes/common.incReturns the base URL path of the Drupal installation. At the very least, this will always default to /.
check_urlincludes/common.incPrepare a URL for use in an HTML attribute. Strips harmful protocols.
drupal_add_cssincludes/common.incAdds a CSS file to the stylesheet queue.
drupal_add_jsincludes/common.incAdd a JavaScript file, setting or inline code to the page.
drupal_add_linkincludes/common.incAdd a <link> tag to the page's HEAD.
drupal_attributesincludes/common.incFormat an attribute string to insert in a tag.
drupal_build_css_cacheincludes/common.incAggregate and optimize CSS files, putting them in the files directory.
drupal_clear_css_cacheincludes/common.incDelete all cached CSS files.
drupal_cloneincludes/common.incProvide a substitute clone() function for PHP4.
drupal_cron_cleanupincludes/common.incShutdown function for cron cleanup.
drupal_cron_runincludes/common.incExecutes a cron run when called
drupal_evalincludes/common.incEvaluate a string of PHP code.
drupal_get_cssincludes/common.incReturns a themed representation of all stylesheets that should be attached to the page. It loads the CSS in order, with 'core' CSS first, then 'module' CSS, then 'theme' CSS files. This ensures proper cascading of styles...
drupal_get_jsincludes/common.incReturns a themed presentation of all JavaScript code for the current page. References to JavaScript files are placed in a certain order: first, all 'core' files, then all 'module' and finally all 'theme' JavaScript...
drupal_get_pathincludes/common.incReturns the path to a system item (module, theme, etc.).
drupal_get_private_keyincludes/common.incEnsure the private key variable used to generate tokens is set.
drupal_get_tokenincludes/common.incGenerate a token based on $value, the current user session and private key.
drupal_mailincludes/common.incSend an e-mail message, using Drupal variables and default settings. More information in the PHP function reference for mail()
drupal_map_associncludes/common.incForm an associative array from a linear array.
drupal_page_footerincludes/common.incPerform end-of-request tasks.
drupal_renderincludes/common.incRenders HTML given a structured array tree. Recursively iterates over each of the array elements, generating HTML code. This function is usually called from within a another function, like drupal_get_form() or node_view().
drupal_system_listingincludes/common.incReturns an array of files objects of the given type from the site-wide directory (i.e. modules/), the all-sites directory (i.e. sites/all/modules/), the profiles directory, and site-specific directory (i.e. sites/somesite/modules/). The returned array...
drupal_to_jsincludes/common.incConverts a PHP variable into its Javascript equivalent.
drupal_urlencodeincludes/common.incWrapper around urlencode() which avoids Apache quirks.
drupal_valid_tokenincludes/common.incValidate a token based on $value, the current user session and private key.
element_childincludes/common.incCheck if the key is a child.
element_childrenincludes/common.incGet keys of a structured array tree element that are not properties (i.e., do not begin with '#').
element_propertiesincludes/common.incGet properties of a structured array element. Properties begin with '#'.
element_propertyincludes/common.incCheck if the key is a property.
flood_is_allowedincludes/common.incCheck 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_eventincludes/common.incRegister an event for the current visitor (hostname/IP) to the flood control mechanism.
format_dateincludes/common.incFormat a date with the given configured format or a custom format string.
format_intervalincludes/common.incFormat a time interval with the requested granularity.
format_pluralincludes/common.incFormat a string containing a count of items.
format_rss_channelincludes/common.incFormats an RSS channel.
format_rss_itemincludes/common.incFormat a single RSS item.
format_sizeincludes/common.incGenerate a string representation for the given byte count.
format_xml_elementsincludes/common.incFormat XML elements.
lincludes/common.incFormat an internal Drupal link.
page_set_cacheincludes/common.incStore the current page in the cache.
parse_sizeincludes/common.incParse a given byte count.
urlincludes/common.incGenerate a URL from a Drupal menu path. Will also pass-through existing URLs.
valid_email_addressincludes/common.incVerify the syntax of the given e-mail address.
valid_urlincludes/common.incVerify the syntax of the given URL.
xmlrpcincludes/common.incPerforms one or more XML-RPC request(s).
_drupal_add_jsincludes/common.incHelper function for drupal_add_js().
_element_sortincludes/common.incFunction used by uasort in drupal_render() to sort structured arrays by weight.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.