BUGFIX: Fix image tracking to take resized images into account (from r86198)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89170 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-15 22:11:19 +00:00
parent 39ceae44c1
commit d2cd852df4

View File

@ -1323,7 +1323,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
}
} else if($link == '' || $link[0] == '/') {
$this->HasBrokenLink = true;
} else if($candidateFile = DataObject::get_one("File", "\"Filename\" = '" . Convert::raw2sql(urldecode($link)) . "'", false)) {
} else if($candidateFile = File::find(Convert::raw2sql(urldecode($link)))) {
$linkedFiles[] = $candidateFile->ID;
}
}
@ -1333,7 +1333,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
foreach($images as $image) {
$image = Director::makeRelative($image);
if(substr($image,0,7) == 'assets/') {
$candidateImage = DataObject::get_one("File", "\"Filename\" = '$image'");
$candidateImage = File::find($image);
if($candidateImage) $linkedFiles[] = $candidateImage->ID;
else $this->HasBrokenFile = true;
}