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