FusionDirectory
 All Data Structures Files Functions Variables
Static Public Member Functions
tests Class Reference

This class provides various test functions. More...

Static Public Member Functions

static is_phone_nr ($nr)
 Test if the given string is a phone number. More...
 
static is_dns_name ($str)
 Test if the given string contains characters allowed in a DNS record name. More...
 
static is_valid_hostname ($str)
 Test if the given string contains characters allowed in a hostname. More...
 
static is_url ($url)
 Test if the given string is an URL. More...
 
static is_dn ($dn)
 Test if the given string is a DN. More...
 
static is_uid ($uid)
 Test if the given string is an uid. More...
 
static is_ip ($ip)
 Test if the given string is an IP (v4 or v6) More...
 
static is_ipv4 ($ip)
 Test if the given string is an IPv4. More...
 
static is_ipv6 ($ip)
 Test if the given string is an IPv6. More...
 
static is_mac ($mac)
 Test if the given string is a mac address. More...
 
static is_ip_with_subnetmask ($ip)
 Checks if the given ip address doesn't match "is_ip" because there is also a sub net mask given. More...
 
static is_domain ($str)
 Simple is domain check. More...
 
static is_id ($id)
 Check if the given argument is an id. More...
 
static is_path ($path)
 Check if the given argument is a path. More...
 
static is_email ($address)
 Check if the given argument is an email. More...
 

Detailed Description

This class provides various test functions.

This class provides various test functions. It enables to check if a given value is:

The functions need to be handled with care, because they are not as strict as one might expect.

Definition at line 41 of file class_tests.inc.

Member Function Documentation

static is_dn (   $dn)
static

Test if the given string is a DN.

Parameters
string$dnThe DN to check

Definition at line 101 of file class_tests.inc.

static is_dns_name (   $str)
static

Test if the given string contains characters allowed in a DNS record name.

Parameters
string$strThe DNS to check

Definition at line 63 of file class_tests.inc.

static is_domain (   $str)
static

Simple is domain check.

This checks if the given string looks like "string(...).string"

Parameters
string$strThe domain to check

Definition at line 225 of file class_tests.inc.

static is_email (   $address)
static

Check if the given argument is an email.

Parameters
string$addressThe email address

Definition at line 269 of file class_tests.inc.

static is_id (   $id)
static

Check if the given argument is an id.

Parameters
string$idThe id to check

Definition at line 236 of file class_tests.inc.

Referenced by eval_sizelimit().

static is_ip (   $ip)
static

Test if the given string is an IP (v4 or v6)

Parameters
string$ipThe IP to check

Definition at line 136 of file class_tests.inc.

static is_ip_with_subnetmask (   $ip)
static

Checks if the given ip address doesn't match "is_ip" because there is also a sub net mask given.

Parameters
string$ipThe IP to check

Definition at line 179 of file class_tests.inc.

static is_ipv4 (   $ip)
static

Test if the given string is an IPv4.

Parameters
string$ipThe IPv4 to check

Definition at line 146 of file class_tests.inc.

static is_ipv6 (   $ip)
static

Test if the given string is an IPv6.

Parameters
string$ipThe IPv6 to check

Definition at line 156 of file class_tests.inc.

static is_mac (   $mac)
static

Test if the given string is a mac address.

Parameters
string$macThe MAC address to check

Definition at line 167 of file class_tests.inc.

static is_path (   $path)
static

Check if the given argument is a path.

Parameters
string$pathThe path to check

Definition at line 251 of file class_tests.inc.

static is_phone_nr (   $nr)
static

Test if the given string is a phone number.

Parameters
string$nrThe phone number to check

Definition at line 48 of file class_tests.inc.

static is_uid (   $uid)
static

Test if the given string is an uid.

Parameters
string$uidThe UID to check

Definition at line 116 of file class_tests.inc.

References strict_uid_mode().

static is_url (   $url)
static

Test if the given string is an URL.

Parameters
string$urlThe URL to check

Definition at line 85 of file class_tests.inc.

static is_valid_hostname (   $str)
static

Test if the given string contains characters allowed in a hostname.

Parameters
string$strThe hostname to check

Definition at line 74 of file class_tests.inc.


The documentation for this class was generated from the following file: