Replaces each succesive %s with succesive array items Note if no %s in string or no $formatStringParameters then returns formatString
static String
arraySprintf
(String $formatString, [array(String) $formatStringParameters = false])
-
String
$formatString: containing %s
-
array(String)
$formatStringParameters: The array of parameters to replace the %s with
Check a value for XHTML errors
static boolean
checkXHTMLValue
(string $value, string &$errors)
-
string
$value: The value to check
-
string
&$errors: : Errors founded, returned by reference
Convert textBody to HTMLBody, convert all links and \n tags
static string,
convertTextToHTML
(string $body, [boolean $withNl2Br = true])
-
string
$body: The body to convert
-
boolean
$withNl2Br: : Use nl2br on returned text (default : true)
Map of CP1252 characters not supported into latin to utf8 encoding
static array
cp1252ToUtf8Map
()
Decode HTML entities (charset insensitive)
static string
decodeEntities
(string $text)
-
string
$text: The HTML value to decode
Replace special chars returned by Windows shell or Word copy/paste by standard ISO 8859-1 chars Static method.
static string
decodeWindowsChars
(string $input)
-
string
$input: The sensitive input
Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length
static string
ellipsis
(string $value, integer $length, [integer $ellipsis = '...'], [boolean $center = false], [boolean $breakWords = true])
-
string
$value: The string value to troncate
-
integer
$length: The maximum length of the returned string
-
integer
$ellipsis: The ellipsis to add at the end of string (default : '...')
-
boolean
$center: If true, cut the string in the middle (default : false)
-
boolean
$breakWords: If false, do not cut the string in the middle of a word (default : true)
Evaluate all php blocks (like <?php ... ? >) founded in input string Static method.
static string
evalPHPCode
(string $input)
-
string
$input: The input string in which eval the code
static void
filter
( $value, [ $filter = ''], [ $default = false])
Generate a random ascii key of determined length
static string
generateKey
(int $keyLength)
-
int
$keyLength: keyLength the desired length of the key
static void
get
( $name, [ $filter = ''], [ $default = false])
Get call infos of the caller function which call this one
static string
getCallInfos
([ $deep = 1])
Cleans a string that has to be echoed to the user.
Static method.
static string
htmlspecialchars
(mixed $input, [ $quote_style = ENT_QUOTES])
-
mixed
$input: The sensitive input.
-
$quote_style
Tests the input to see if it is part of a given set of values.
Static method.
static boolean
isInSet
(mixed $input, array(mixed) $set)
-
mixed
$input: The sensitive input.
-
array(mixed)
$set: The set the input should be part of
Tests the input to see if it is a positive integer.
Static method.
static boolean
isPositiveInteger
(mixed $input)
-
mixed
$input: The sensitive input
Tests the input to see if it is an integer between min and max value.
Static method.
static boolean
isUnderRange
(mixed $input, mixed $min, mixed $max)
-
mixed
$input: The sensitive input
-
mixed
$min: The min value
-
mixed
$max: The max value
Try to detect UTF-8 content
static boolean
isUTF8
( $string)
Parses input string for email format correctness Static method.
static boolean
isValidEmail
( $email, [ $checkDomain = false], String $email.)
-
String
$email.
-
$email
-
$checkDomain
Check if the login is valid
static boolean
isValidLogin
(string $login)
Parses input string as if it is a password, and return the "well-formed" status : must be at least 5 chars long, ...
Static method.
static boolean
isValidPassword
(string $input)
-
string
$input: the user input to be login
Encode a multidimentionnal array in json format Convert datas in utf-8 if needed
static string
jsonEncode
(array $datas)
-
array
$datas: The datas to convert
Callback function for natural sorting without care of accentuation
Usage : Sort on array values : uasort( (array) $array, array('io','natcasecmp')); Sort on array keys : uksort( (array) $array, array('io','natcasecmp'));
static void
natcasecmp
( $str1, $str2)
static void
post
( $name, [ $filter = ''], [ $default = false])
static void
printBackTrace
( $backtrace)
Check a value and force reencode of ampersand without double encode them :
& => & & => & é => é { => {
static string
reencodeAmpersand
(string $text)
-
string
$text: The HTML value to reencode
Filter request input Static method.
static mixed
request
(string $name, [mixed $filter = ''], [mixed $default = false])
-
string
$name: The request name to filter
-
mixed
$filter: The filter to use. Can be :
- a string of a function name or static object method (class::method) to use for the check (must return true / false)
- a string for a regular expression to validate with preg_match
- an array of possible values (case sensitive)
- nothin, in this case, the request value is returned as it (if it exists)
-
mixed
$default: The default value to return if request is empty or does not match the filter rule (default : false)
Map of non-ascii characters to convert in ascii equivalent
static array
sanitizeAsciiMap
()
Cleans a string containing other thing than [a..zA..Z0..9_.-] but translates spaces to _ and accentuated chars to their non-accentuated counterpart before.
Static method.
static string
sanitizeAsciiString
(string $input, [string $keep = ''], [string $special = '_.-'])
-
string
$input: The sensitive input.
-
string
$keep: The meta caracters to keep with _.- (default : none).
-
string
$special: The special caracters allowed (default : "_.-").
Cleans a string that has to be used in an exec command For now, remove backticks ` in string Static method.
static string
sanitizeExecCommand
(mixed $input)
-
mixed
$input: The sensitive input.
static void
sanitizeHTMLString
( $input)
Cleans a string to use it in a JS var Remove line breaks and add slashes to single quotes
static string
sanitizeJSString
( $input, [ $minimize = false], [ $addslashes = true], [ $keepCariageReturn = false], mixed $input:, boolean $minimize:, boolean $addslashes:)
-
mixed
$input:: The sensitive input.
-
boolean
$minimize:: Use jsmin to minimise JS, this will also strip comments (default : false)
-
boolean
$addslashes:: add slashes around single quotes (default : true);
-
$input
-
$minimize
-
$addslashes
-
$keepCariageReturn
Cleans a string that is to be put into a SQL query.
Actually, only escapes single quotes that are not already escaped. Static method.
static string
sanitizeSQLString
(mixed $input)
-
mixed
$input: The sensitive input.
Cleans a string containing other thing than [a..z0..9-] Translates spaces to - and accentuated chars to their non-accentuated counterpart before.
Then lower the case of the sring Static method.
static string
sanitizeURLString
(mixed $input)
-
mixed
$input: The sensitive input.
Cleans a string that must not contain php opening and closing tags Static method.
static string
stripPHPTags
(mixed $input)
-
mixed
$input: The sensitive input.
static void
strtolower
()
static void
strtoupper
()
Rewrite some PHP functions to be charset insensitive
static mixed
substr
()
Unset request input Static method.
static void
unsetRequest
(string/array $requests)
-
string/array
$requests: The request(s) name to unset
Decode String from UTF8 to latin1 with support of cp1252 charset
static string
utf8Decode
(string $text)
-
string
$text: The to decode
Encode ISO8859-1 string to UTF8 with support of cp1252 charset
static string
utf8Encode
(string $text)
-
string
$text: The to encode
Generated a Universal Unique Identifier (UUID) generated according to “DCE 1.1: Remote Procedure Call” (Appendix A) CAE (Common Applications Environment) Specifications published by The Open Group in October 1997 (Document Number C706, http://www.opengroup.org/public/pubs/catalog/c706.htm).
static string
uuid
()
Inherited Methods
Inherited From CMS_grandFather
CMS_grandFather::autoload()
CMS_grandFather::hasError()
CMS_grandFather::log()
CMS_grandFather::PHPErrorHandler()
CMS_grandFather::raiseError()
CMS_grandFather::setDebug()
CMS_grandFather::setLog()
CMS_grandFather::_raiseError()
CMS_grandFather::__call()