if source is empty, set it to null

git-svn-id: file:///home/shish/svn/shimmie2/trunk@582 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-10-27 23:53:48 +00:00
parent 25509b15b8
commit d2c1ec66a9

View File

@ -170,6 +170,9 @@ class ImageIO extends Extension {
/*
* Validate things
*/
if(strlen(trim($image->source)) == 0) {
$image->source = null;
}
if(!empty($image->source)) {
if(!preg_match("#^(https?|ftp)://#", $image->source)) {
$error = "Image's source isn't a valid URL";