if source is empty, set it to null (branch_2.1)

git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@583 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-10-27 23:55:53 +00:00
parent 50b9880d2d
commit 53cf70a071

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";