From f38840070cc2d6b7c43cb30807ccb5c45f5a8a03 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sat, 7 Oct 2017 17:44:15 +0100 Subject: [PATCH] Update getBasePath to use something a bit more sane --- CRM/Utils/System/Joomla.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 6846c21cec..74fb2cef2a 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -523,9 +523,15 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } } + /** + * Setup the base path related constant. + * @return mixed + */ public function getBasePath() { - // Setup the base path related constant. - return dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))); + global $civicrm_root; + $joomlaPath = explode('/administrator', $civicrm_root); + $joomlaBase = $joomlaPath[0]; + return $joomlaBase; } /** -- 2.25.1