12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace Lychee\Modules;
- final class Validator {
- public static function required($available = false, $function) {
- if ($available===false) exit("Error: Missing parameters. Can not execute function $function.");
- return true;
- }
- public static function isNull() {
- $args = func_get_args();
- for ($i = 0; $i < count($args); $i++) {
- if (is_null($args[$i])===true) return true;
- }
- return false;
- }
- public static function isAlbumIDs($albumIDs) {
- return (preg_match('/^[0-9\,]{1,}$/', $albumIDs)===1 ? true : false);
- }
- public static function isAlbumID($albumID) {
- return (preg_match('/^[0-9sfr]{1,}$/', $albumID)===1 ? true : false);
- }
- public static function isPhotoIDs($photoIDs) {
- return (preg_match('/^[0-9\,]{1,}$/', $photoIDs)===1 ? true : false);
- }
- public static function isPhotoID($photoID) {
- return (preg_match('/^[0-9]{14}$/', $photoID)===1 ? true : false);
- }
- }
- ?>
|