Commit bcd7f4a5 authored by Jon goldberg's avatar Jon goldberg

CRM-18799 - remove use of exec in WordPress bootstrap

parent 0daa53ad
......@@ -396,20 +396,23 @@ class Bootstrap {
*/
protected function getSearchDir() {
if ($this->options['search'] === TRUE) {
// exec(pwd) works better with symlinked source trees, but it's
// probably not portable to Windows.
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if ($_SERVER['SCRIPT_FILENAME']) {
return dirname($_SERVER['SCRIPT_FILENAME']);
}
// getenv('PWD') works better with symlinked source trees, but it's
// not portable to Windows.
elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return getcwd();
}
else {
exec('pwd', $output);
return trim(implode("\n", $output));
return getenv('PWD');
}
}
else {
return $this->options['search'];
}
}
}
\Civi\Cv\Bootstrap::singleton()->boot();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment