E-mail address validation.
boolean
check_email
(string $email, [boolean $dns_check = true])
-
string
$email: Email address
-
boolean
$dns_check: True to check dns
Validates IPv4 or IPv6 address
bool
check_ip
(string $ip)
-
string
$ip: IP address in v4 or v6 format
Check whether the HTTP referer matches the current request
boolean
check_referer
()
Explode quoted string
array
explode_quoted_string
(string $delimiter, string $string)
-
string
$delimiter: Delimiter expression string for preg_match()
-
string
$string: Input string
Generate CSS classes from mimetype and filename extension
string
file2class
(string $mimetype, string $filename)
-
string
$mimetype: Mimetype
-
string
$filename: Filename
Find out if the string content means true or false
boolean
get_boolean
(string $str)
Read input value and convert it for internal use Performs stripslashes() and charset conversion if necessary
string
get_input_value
(string $fname, int $source, [boolean $allow_html = FALSE], [string $charset = NULL])
-
string
$fname: Field name to read
-
int
$source: Source to get value from (GPC)
-
boolean
$allow_html: Allow HTML tags in field value
-
string
$charset: Charset to convert into
Parse commandline arguments into a hash array
array
get_opt
([array $aliases = array()])
-
array
$aliases: Argument alias names
Convert the given string into a valid HTML identifier
Same functionality as done in app.js with rcube_webmail.html_identifier()
void
html_identifier
( $str, [ $encode = false])
Check if working in SSL mode
boolean
https_check
([integer $port = null], [boolean $use_https = true])
-
integer
$port: HTTPS port number
-
boolean
$use_https: Enables 'use_https' option checking
void
idn_convert
( $input, [ $is_utf = false])
void
idn_to_ascii
( $str)
Check if we can process not exceeding memory_limit
boolean
mem_check
(integer $need)
-
integer
$need: Required amount of memory
Replace all css definitions with #container [def] and remove css-inlined scripting
string
mod_css_styles
(string $source, string $container_id, [ $allow_remote = false])
-
string
$source: CSS source code
-
string
$container_id: Container ID to use as prefix
-
$allow_remote
Normalize the given string for fulltext search.
Currently only optimized for Latin-1 characters; to be extended
mixed
normalize_string
(string $str, [boolean $as_array = false])
-
string
$str: Input string (UTF-8)
-
boolean
$as_array: True to return list of words as array
Replaces hostname variables.
string
parse_host
(string $name, [string $host = ''])
-
string
$name: Hostname
-
string
$host: Optional IMAP hostname
Parse/validate input value. See self::get_input_value() Performs stripslashes() and charset conversion if necessary
string
parse_input_value
(string $value, [boolean $allow_html = FALSE], [string $charset = NULL])
-
string
$value: Input value
-
boolean
$allow_html: Allow HTML tags in field value
-
string
$charset: Charset to convert into
Safe password prompt for command line from http://blogs.sitepoint.com/2009/05/01/interactive-cli-password-prompt-in-php/
string
prompt_silent
([ $prompt = "Password:"])
Returns remote IP address and forwarded addresses if found
string
remote_ip
()
Replacing specials characters to a specific encoding type
string
rep_specialchars_output
(string $str, [string $enctype = ''], [string $mode = ''], [boolean $newlines = true])
-
string
$str: Input string
-
string
$enctype: Encoding type: text|html|xml|js|url
-
string
$mode: Replace mode for tags: show|replace|remove
-
boolean
$newlines: Convert newlines
Convert array of request parameters (prefixed with _) to a regular array with non-prefixed keys.
array
request2param
([int $mode = null], [string $ignore = 'task|action'])
-
int
$mode: Source to get value from (GPC)
-
string
$ignore: PCRE expression to skip parameters by name
Read a specific HTTP request header.
mixed
request_header
(string $name)
-
string
$name: Header name
Helper method to set a cookie with the current path and host settings
void
setcookie
(string $name, string $value, [string $exp = 0])
-
string
$name: Cookie name
-
string
$value: Cookie value
-
string
$exp: Expiration time
Improved equivalent to strtotime()
int
strtotime
(string $date)
-
string
$date: Date string
Split the given string into word tokens
array
tokenize_string
(string $str)
-
string
$str: Input to tokenize
Decode escaped entities used by known XSS exploits.
See http://downloads.securityfocus.com/vulnerabilities/exploits/26800.eml for examples
string
xss_entity_decode
(string $content)
-
string
$content: CSS content to decode
preg_replace_callback callback for xss_entity_decode
string
xss_entity_decode_callback
(array $matches)
-
array
$matches: Result from preg_replace_callback