Input validation


Functions

 valid_email_address ($mail)
 valid_url ($url, $absolute=FALSE)

Detailed Description

Functions to validate user input.

Function Documentation

valid_email_address ( mail  ) 

Verify the syntax of the given e-mail address.

Empty e-mail addresses are allowed. See RFC 2822 for details.

Parameters:
$mail A string containing an e-mail address.
Returns:
TRUE if the address is in a valid format.

Definition at line 816 of file common.inc.

Referenced by contact_admin_edit_validate(), contact_mail_page_validate(), contact_user_page(), and update_settings_validate().

valid_url ( url,
absolute = FALSE 
)

Verify the syntax of the given URL.

This function should only be used on actual URLs. It should not be used for Drupal menu paths, which can contain arbitrary characters.

Parameters:
$url The URL to verify.
$absolute Whether the URL is absolute (beginning with a scheme such as "http:").
Returns:
TRUE if the URL is in a valid format.

Definition at line 838 of file common.inc.

References $url.

Referenced by aggregator_form_feed_validate().


Generated on Mon Jun 2 15:08:36 2008 for SimpleTest by  1.5.5