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 { ...@@ -396,20 +396,23 @@ class Bootstrap {
*/ */
protected function getSearchDir() { protected function getSearchDir() {
if ($this->options['search'] === TRUE) { if ($this->options['search'] === TRUE) {
// exec(pwd) works better with symlinked source trees, but it's if ($_SERVER['SCRIPT_FILENAME']) {
// probably not portable to Windows. return dirname($_SERVER['SCRIPT_FILENAME']);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { }
// 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(); return getcwd();
} }
else { else {
exec('pwd', $output); return getenv('PWD');
return trim(implode("\n", $output));
} }
} }
else { else {
return $this->options['search']; return $this->options['search'];
} }
} }
} }
\Civi\Cv\Bootstrap::singleton()->boot(); \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