mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Ensure ASSETS_PATH is respected
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88281 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
98dda12a9d
commit
e21297ecc0
@ -98,7 +98,7 @@ class Image extends File {
|
||||
* @return string
|
||||
*/
|
||||
function getTag() {
|
||||
if(file_exists("../" . $this->Filename)) {
|
||||
if(file_exists($this->FullPath)) {
|
||||
$url = $this->URL();
|
||||
$title = ($this->Title) ? $this->Title : $this->Filename;
|
||||
|
||||
@ -790,4 +790,4 @@ class Image_Uploader extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -422,14 +422,14 @@ class File extends DataObject {
|
||||
}
|
||||
|
||||
function getFullPath() {
|
||||
$baseFolder = Director::baseFolder();
|
||||
$baseFolder = ASSETS_PATH;
|
||||
|
||||
if(strpos($this->getFilename(), $baseFolder) === 0) {
|
||||
// if path is absolute already, just return
|
||||
return $this->getFilename();
|
||||
} else {
|
||||
// otherwise assume silverstripe-basefolder
|
||||
return Director::baseFolder() . '/' . $this->getFilename();
|
||||
return substr(ASSETS_PATH, 0, strlen(ASSETS_PATH) - strlen(ASSETS_DIR)) . $this->getFilename();
|
||||
}
|
||||
}
|
||||
|
||||
@ -615,4 +615,4 @@ class File extends DataObject {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user