mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
65ae0bbd67
commit
5066247b68
@ -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\" />";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user