You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lychee/php/Modules/Validator.php

41 lines
753 B

<?php
namespace Lychee\Modules;
final class Validator {
public static function required($available = false, $function) {
if ($available===false) Response::error('Missing parameters. Can not execute function ' . $function);
return true;
}
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);
}
}
?>