Revize 74a7dbca
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
application/helpers/valid.php | ||
---|---|---|
return preg_match ("/^[0-9]+(\.[0-9]+)?[k|M|G|T]?B$/", $str);
|
||
}
|
||
|
||
/**
|
||
* Checks whether string is valid for upload_max_filesize and
|
||
* post_max_size values
|
||
*
|
||
* @author David Raska
|
||
* @param string $str
|
||
* @return boolean
|
||
*/
|
||
public static function file_size($str)
|
||
{
|
||
return preg_match ("/^([1-9][0-9]*[k|M|G]?)$/i", $str);
|
||
}
|
||
|
||
/**
|
||
* Checks whether string is valid speed size (eg. in format 2M/8M)
|
||
*
|
Také k dispozici: Unified diff
Merge from SVN branch 1.2.