From 945ccd6c94f959d10cf2a15394d2d5511c8bfc24 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 20 Dec 2016 14:05:31 -0800 Subject: [PATCH] CRM-19826 - CRM_Extension_System - Fix extra slash in `vendor` URLs If you install an extension under `$cmsRoot/vendor/org.example.foo`, the resulting URL contains an extraneous `/` (eg `http://example.org//vendor/org.example.foo`). (In Windows, I suspect it's even worse because it uses DIRECTORY_SEPARATOR in the URl -- eg `http://example.org/\vendor/org.example.foo`.) This patch checks for and removes the extraneous slash -- and always constructs the URL with the appropriate delimiter (`/`). Problem observed in `dmaster`. --- CRM/Extension/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index 3a95ab8ae313..826f3f15a499 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -144,7 +144,7 @@ public function getFullContainer() { if (is_dir($vendorPath)) { $containers['cmsvendor'] = new CRM_Extension_Container_Basic( $vendorPath, - $this->parameters['userFrameworkBaseURL'] . DIRECTORY_SEPARATOR . 'vendor', + CRM_Utils_File::addTrailingSlash($this->parameters['userFrameworkBaseURL'], '/') . 'vendor', $this->getCache(), 'cmsvendor' );