mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE #3600 Inconsistency in File::getURL() which returns an absolute URL, when it should be relative - please use getAbsoluteURL() instead for old behaviour
API CHANGE #3600 Image no longer has an explicit getURL() method, instead it inherits getURL() from File which returns a relative URL git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96988 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
916be1aa2f
commit
e77964a5b9
@ -81,18 +81,6 @@ class Image extends File {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the relative URL for this Image.
|
||||
* Overwrites File->URL() which returns an absolute URL.
|
||||
*
|
||||
* @todo Refactor to return absolute URL like {@link File}
|
||||
* @uses Director::baseURL()
|
||||
* @return string
|
||||
*/
|
||||
function getURL() {
|
||||
return Director::baseURL() . $this->Filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an XHTML img tag for this Image.
|
||||
* @return string
|
||||
|
@ -421,13 +421,13 @@ class File extends DataObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the absolute URL accessible through the web.
|
||||
* Gets the relative URL accessible through the web.
|
||||
*
|
||||
* @uses Director::absoluteBaseURL()
|
||||
* @uses Director::baseURL()
|
||||
* @return string
|
||||
*/
|
||||
function getURL() {
|
||||
return Director::absoluteBaseURL() . $this->getFilename();
|
||||
return Director::baseURL() . $this->getFilename();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user