Skip to content

Commit

Permalink
Merge pull request #15919 from kcristiano/5.20-1412
Browse files Browse the repository at this point in the history
dev/core/1412  CiviMail sent via wp-cli and cron mangles mailing urls…
  • Loading branch information
seamuslee001 authored Nov 21, 2019
2 parents 0350a23 + 57811df commit 375ea78
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions CRM/Utils/System/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,23 +558,10 @@ public function cmsRootPath() {
}
}
else {
$pathVars = explode('/', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']));

//might be windows installation.
$firstVar = array_shift($pathVars);
if ($firstVar) {
$cmsRoot = $firstVar;
}

//start w/ csm dir search.
foreach ($pathVars as $var) {
$cmsRoot .= "/$var";
if ($this->validInstallDir($cmsRoot)) {
//stop as we found bootstrap.
$valid = TRUE;
break;
}
}
$setting = Civi::settings()->get('wpLoadPhp');
$path = str_replace('wp-load.php', '', $setting);
$cmsRoot = rtrim($path, '/\\');
$valid = TRUE;
}

return ($valid) ? $cmsRoot : NULL;
Expand Down

0 comments on commit 375ea78

Please sign in to comment.