diff --git a/core/model/Image.php b/core/model/Image.php index d5b96eb5f..3f6abafa9 100755 --- a/core/model/Image.php +++ b/core/model/Image.php @@ -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; @@ -790,4 +790,4 @@ class Image_Uploader extends Controller { } } -?> +?> \ No newline at end of file diff --git a/filesystem/File.php b/filesystem/File.php index ce6dcfbcd..a7f016f8e 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -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(); } } @@ -615,4 +615,4 @@ class File extends DataObject { } -?> +?> \ No newline at end of file