Same name and namespace in other branches
- 4.7.x includes/common.inc \validation
- 5.x includes/common.inc \validation
- 6.x includes/common.inc \validation
- 7.x includes/common.inc \validation
- 8.9.x core/includes/common.inc \validation
Functions to validate user input.
File
- includes/
common.inc, line 549 - Common functions that many Drupal modules will need to reference.
Functions
Name | Location | Description |
---|---|---|
check_file |
includes/ |
|
check_url |
includes/ |
Prepare a URL for use in an HTML attribute. Strips harmful protocols. |
decode_entities |
includes/ |
Decode all HTML entities (including numerical ones) to regular UTF-8 bytes. Double-escaped entities will only be decoded once ("&lt;" becomes "<", not "<"). |
drupal_add_link |
includes/ |
Add a <link> tag to the page's HEAD. |
drupal_attributes |
includes/ |
Format an attribute string to insert in a tag. |
drupal_check_token |
includes/ |
Check the form token if there is POST data for an authenticated user to defend against cross site request forgeries. |
drupal_convert_to_utf8 |
includes/ |
Convert data to UTF-8 |
drupal_eval |
includes/ |
Evaluate a string of PHP code. |
drupal_get_path |
includes/ |
Returns the path to a system item (module, theme, etc.). |
drupal_get_private_key |
includes/ |
Ensure the private key variable used to generate tokens is set. |
drupal_get_token |
includes/ |
Generate a token based on $value, the current user session and private key. |
drupal_map_assoc |
includes/ |
Form an associative array from a linear array. |
drupal_page_footer |
includes/ |
Perform end-of-request tasks. |
drupal_valid_token |
includes/ |
Validate a token based on $value, the current user session and private key or penultimate private key. |
drupal_xml_parser_create |
includes/ |
Prepare a new XML parser. |
flood_is_allowed |
includes/ |
Check 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_event |
includes/ |
Register an event for the current visitor (hostname/IP) to the flood control mechanism. |
form |
includes/ |
Generate a form from a set of form elements. |
format_date |
includes/ |
Format a date with the given configured format or a custom format string. |
format_interval |
includes/ |
Format a time interval with the requested granularity. |
format_name |
includes/ |
Format a username. |
format_plural |
includes/ |
Format a string containing a count of items. |
format_rss_channel |
includes/ |
Formats an RSS channel. |
format_rss_item |
includes/ |
Format a single RSS item. |
format_size |
includes/ |
Generate a string representation for the given byte count. |
form_button |
includes/ |
Format an action button. |
form_checkbox |
includes/ |
Format a checkbox. |
form_checkboxes |
includes/ |
Format a set of checkboxes. |
form_file |
includes/ |
Format a file upload field. |
form_get_errors |
includes/ |
Return an associative array of all errors. |
form_group |
includes/ |
Format a group of form items. |
form_hidden |
includes/ |
Store data in a hidden form field. |
form_item |
includes/ |
Format a general form item. |
form_password |
includes/ |
Format a single-line text field that does not display its contents visibly. |
form_radio |
includes/ |
Format a radio button. |
form_radios |
includes/ |
Format a set of radio buttons. |
form_select |
includes/ |
Format a dropdown menu or scrolling selection box. |
form_set_error |
includes/ |
File an error against the form element with the specified name. |
form_submit |
includes/ |
Format a form submit button. |
form_textarea |
includes/ |
Format a multiple-line text field. |
form_textfield |
includes/ |
Format a single-line text field. |
form_token |
includes/ |
Generate a form token based on the session and the private key to defend against cross site request forgeries. |
form_weight |
includes/ |
Format a weight selection menu. |
l |
includes/ |
Format an internal Drupal link. |
mime_header_encode |
includes/ |
Encodes MIME/HTTP header values that contain non-ASCII, UTF-8 encoded characters. |
string_length |
includes/ |
Count the amount of characters in a UTF-8 string. This is less than or equal to the byte count. |
truncate_utf8 |
includes/ |
Truncate a UTF-8-encoded string safely. |
url |
includes/ |
Generate an internal Drupal URL. |
valid_email_address |
includes/ |
Verify the syntax of the given e-mail address. |
valid_url |
includes/ |
Verify the syntax of the given URL. |
_decode_entities |
includes/ |
Helper function for decode_entities |
_form_get_class |
includes/ |
|
_form_get_error |
includes/ |
Return the error message filed against the form with the specified name. |
Sub-Topics
Name | Location | Description |
---|---|---|
Form generation |
includes/ |
Functions to enable output of HTML forms and form elements. |
Formatting |
includes/ |
Functions to format numbers, strings, dates, etc. |