Skip to content

Commit

Permalink
Merge pull request #8494 from kcristiano/CRM-18221
Browse files Browse the repository at this point in the history
CRM-18221 filter relativize with realpath function to properly configure [civicrm.root] and [civicrm.files] on hosts with symlinked file systems
  • Loading branch information
eileenmcnaughton authored Jun 21, 2016
2 parents a5bdb2b + d818240 commit a46aac2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CRM/Utils/System/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ public function getCiviSourceStorage() {
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, '/'),
Expand Down Expand Up @@ -212,8 +211,9 @@ public function url(

//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') != '') {
Expand Down Expand Up @@ -435,7 +435,7 @@ public function loadBootStrap($name = NULL, $pass = NULL) {
$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 '<br />Sorry, unrecognized username or password.';
Expand Down

0 comments on commit a46aac2

Please sign in to comment.