MINOR: removed file path and extension from image's alt attribe that accessware.co.nz complains about

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76626 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Saophalkun Ponlu 2009-05-12 04:00:32 +00:00 committed by Sam Minnee
parent 65ae0bbd67
commit 5066247b68

View File

@ -101,6 +101,13 @@ class Image extends File {
if(file_exists("../" . $this->Filename)) {
$url = $this->URL();
$title = ($this->Title) ? $this->Title : $this->Filename;
// remove file path and extension
// that accessware.co.nz complains about this
if (preg_match("/([^\/.]*)\..{1,6}$/", $title, $matches)) {
$title = $matches[1];
}
return "<img src=\"$url\" alt=\"$title\" />";
}
}