Skip to content
Snippets Groups Projects
Verified Commit 9470e1fb authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

CiviMail sent via wp-cli and cron mangles mailing urls

parent 73b77710
No related branches found
No related tags found
No related merge requests found
...@@ -558,23 +558,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { ...@@ -558,23 +558,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
} }
} }
else { else {
$pathVars = explode('/', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME'])); $setting = Civi::settings()->get('wpLoadPhp');
$path = str_replace('wp-load.php', '', $setting);
//might be windows installation. $cmsRoot = rtrim($path, '/\\');
$firstVar = array_shift($pathVars); $valid = TRUE;
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;
}
}
} }
return ($valid) ? $cmsRoot : NULL; return ($valid) ? $cmsRoot : NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment