From e6d3bb0e13ead5dc62e04578e6e80f3c9f3e6de5 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 6 Aug 2007 18:45:27 +0000 Subject: [PATCH] check that source is some sort of url git-svn-id: file:///home/shish/svn/shimmie2/trunk@432 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/image/main.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/image/main.php b/ext/image/main.php index e0c30ce3..a888f357 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -167,6 +167,16 @@ class ImageIO extends Extension { global $database; global $config; + /* + * Validate things + */ + if(!empty($image->source)) { + if(!preg_match("#^(https?|ftp)://#", $image->source)) { + $error = "Image's source isn't a valid URL"; + return $error; + } + } + /* * Check for an existing image */