PHP Class PrivateBin\Filter

Provides data filtering functions.
显示文件 Open project: privatebin/privatebin Class Usage Examples

Public Methods

Method Description
formatHumanReadableSize ( integer $size ) : string format a given number of bytes in IEC 80000-13:2008 notation (localized)
formatHumanReadableTime ( string $time ) : string format a given time string into a human readable label (localized)
slowEquals ( string $a, string $b ) : boolean fixed time string comparison operation to prevent timing attacks https://crackstation.net/hashing-security.htm?=rd#slowequals
stripslashesDeep ( mixed $value ) : mixed strips slashes deeply

Method Details

formatHumanReadableSize() public static method

format a given number of bytes in IEC 80000-13:2008 notation (localized)
public static formatHumanReadableSize ( integer $size ) : string
$size integer
return string

formatHumanReadableTime() public static method

accepts times in the format "[integer][time unit]"
public static formatHumanReadableTime ( string $time ) : string
$time string
return string

slowEquals() public static method

fixed time string comparison operation to prevent timing attacks https://crackstation.net/hashing-security.htm?=rd#slowequals
public static slowEquals ( string $a, string $b ) : boolean
$a string
$b string
return boolean

stripslashesDeep() public static method

strips slashes deeply
public static stripslashesDeep ( mixed $value ) : mixed
$value mixed
return mixed