bleh, source validation. Anything is allowed and it's only linked on output if appropriate

This commit is contained in:
Shish 2012-03-25 04:45:47 +01:00
parent 893afe5b61
commit 7a6ef55114

View file

@ -298,11 +298,6 @@ class ImageIO extends Extension {
if(strlen(trim($image->source)) == 0) {
$image->source = null;
}
if(!empty($image->source)) {
if(!preg_match("#^(https?|ftp)://#", $image->source)) {
throw new ImageAdditionException("Image's source isn't a valid URL");
}
}
/*
* Check for an existing image
@ -431,12 +426,6 @@ class ImageIO extends Extension {
if(strlen(trim($image->source)) == 0) {
$image->source = $existing->get_source();
}
if(!empty($image->source)) {
if(!preg_match("#^(https?|ftp)://#", $image->source)) {
$h_url = html_escape($image->source);
throw new ImageReplaceException("Image's source isn't a valid URL ($h_url)");
}
}
/*
This step could be optional, ie: perhaps move the image somewhere