From 474a6a9931ebc180c029dd2c81820e63d3e3fc5b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 Apr 2010 03:29:56 +0000 Subject: [PATCH] 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 (from r96988) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102415 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Image.php | 12 ------------ filesystem/File.php | 6 +++--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/core/model/Image.php b/core/model/Image.php index eeb17804d..f2390d6eb 100755 --- a/core/model/Image.php +++ b/core/model/Image.php @@ -88,18 +88,6 @@ class Image extends File { $this->deleteFormattedImages(); } - /** - * 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 diff --git a/filesystem/File.php b/filesystem/File.php index d2d4d6b1e..a382b41d8 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -425,13 +425,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(); } /**