From bb9944e6ec729f702ecc2ad81abca155160b234e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 6 Mar 2013 19:23:35 -0500 Subject: [PATCH] CRM-12030 - Use getRelUrls() instead of getRelPaths() to construct URLs --- CRM/Extension/Container/Basic.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CRM/Extension/Container/Basic.php b/CRM/Extension/Container/Basic.php index 99138a0fb3..c6fe7a674b 100644 --- a/CRM/Extension/Container/Basic.php +++ b/CRM/Extension/Container/Basic.php @@ -114,7 +114,7 @@ class CRM_Extension_Container_Basic implements CRM_Extension_Container_Interface * {@inheritdoc} */ public function getResUrl($key) { - return $this->baseUrl . $this->getRelPath($key); + return $this->baseUrl . $this->getRelUrl($key); } /** @@ -182,6 +182,20 @@ class CRM_Extension_Container_Basic implements CRM_Extension_Container_Interface return $this->relPaths; } + /** + * Determine the relative path of an extension directory + * + * @return string + * @throws CRM_Extension_Exception + */ + protected function getRelUrl($key) { + $relUrls = $this->getRelUrls(); + if (! isset($relUrls[$key])) { + throw new CRM_Extension_Exception_MissingException("Failed to find extension: $key"); + } + return $relUrls[$key]; + } + /** * Scan $basedir for a list of extension-keys * -- 2.25.1