From: Kevin Cristiano Date: Sun, 5 Jun 2016 16:38:08 +0000 (-0600) Subject: CRM-18221 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d8182404b336a6e57cd8a06daa6e526e46951c0b;p=civicrm-core.git 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 --- 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.';