From d8182404b336a6e57cd8a06daa6e526e46951c0b Mon Sep 17 00:00:00 2001 From: Kevin Cristiano Date: Sun, 5 Jun 2016 10:38:08 -0600 Subject: [PATCH] CRM-18221 - filter relativize with realpath function to properly configure [civicrm.root] and [civicrm.files] on hosts with symlinked file systems - style cleanups ---------------------------------------- * CRM-18221: CiviCRM Resource URL causing issues on initial install with WP https://issues.civicrm.org/jira/browse/CRM-18221 --- CRM/Utils/System/WordPress.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 1ec0c355f0..b8608b6f72 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -112,8 +112,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { if (CRM_Utils_System::isSSL()) { $cmsUrl = str_replace('http://', 'https://', $cmsUrl); } - - $civiRelPath = CRM_Utils_File::relativize($civicrm_root, $cmsPath); + $civiRelPath = CRM_Utils_File::relativize(realpath($civicrm_root), realpath($cmsPath)); $civiUrl = rtrim($cmsUrl, '/') . '/' . ltrim($civiRelPath, ' /'); return array( 'url' => CRM_Utils_File::addTrailingSlash($civiUrl, '/'), @@ -212,8 +211,9 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { //this means wp function we are trying to use is not available, //so load bootStrap + // FIXME: Why bootstrap in url()? Generally want to define 1-2 strategic places to put bootstrap if (!function_exists('get_option')) { - $this->loadBootStrap(); // FIXME: Why bootstrap in url()? Generally want to define 1-2 strategic places to put bootstrap + $this->loadBootStrap(); } if ($config->userFrameworkFrontend) { if (get_option('permalink_structure') != '') { @@ -435,7 +435,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { $name = $name ? $name : trim(CRM_Utils_Array::value('name', $_REQUEST)); $pass = $pass ? $pass : trim(CRM_Utils_Array::value('pass', $_REQUEST)); if ($name) { - $uid = wp_authenticate($name, $pass); // this returns a WP_User object if successful + $uid = wp_authenticate($name, $pass); if (!$uid) { if ($throwError) { echo '
Sorry, unrecognized username or password.'; -- 2.25.1