git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88282 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2009-10-07 22:24:49 +00:00 committed by Sam Minnee
parent e21297ecc0
commit ad7c4eca89
2 changed files with 5 additions and 5 deletions

View File

@ -98,7 +98,7 @@ class Image extends File {
* @return string
*/
function getTag() {
if(file_exists($this->FullPath)) {
if(file_exists("../" . $this->Filename)) {
$url = $this->URL();
$title = ($this->Title) ? $this->Title : $this->Filename;

View File

@ -422,14 +422,14 @@ class File extends DataObject {
}
function getFullPath() {
$baseFolder = ASSETS_PATH;
$baseFolder = Director::baseFolder();
if(strpos($this->getFilename(), $baseFolder) === 0) {
// if path is absolute already, just return
return $this->getFilename();
} else {
// otherwise assume silverstripe-basefolder
return substr(ASSETS_PATH, 0, strlen(ASSETS_PATH) - strlen(ASSETS_DIR)) . $this->getFilename();
return Director::baseFolder() . '/' . $this->getFilename();
}
}