BUGFIX #3916 bribaudo: Don't throw an error on HTMLEditorField save if a link is empty.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78563 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-06-08 00:34:58 +00:00
parent 710bb89396
commit 8cf4986397

View File

@ -60,7 +60,7 @@ class HtmlEditorField extends TextareaField {
// Prevents execution timeouts if a page has 50 identical broken links by only highlighting them once
$alreadyHighlighted[$parts[1]] = true;
}
} else if($link[0] == '/') {
} else if($link == '' || $link[0] == '/') {
$broken = true;
} else if(ereg('^assets/',$link)) {
$link = str_replace(array('%20', '%5C', '%27'), array(' ', '\\', '\''), $link);
@ -137,7 +137,7 @@ class HtmlEditorField extends TextareaField {
$record->HasBrokenLink = 1;
}
} else if($link{0} == '/') {
} else if($link == '' || $link[0] == '/') {
$record->HasBrokenLink = 1;
} else if($candidateFile = DataObject::get_one("File", "\"Filename\" = '" . Convert::raw2sql(urldecode($link)) . "'", false)) {