diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 6eed432f7..c1a5c9ead 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -138,8 +138,8 @@ class workspaceTools * ((define('()2', ')1 ()3 (');)4 )0 */ $dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'rb_', 'DB_RBAC_USER' => 'rb_', 'DB_REPORT_NAME' => 'rp_', 'DB_REPORT_USER' => 'rp_'); - $key = $matches['key']; - $value = $matches['value']; + $key = isset($matches['key']) ? $matches['key'] : $matches[2]; + $value = isset($matches['value']) ? $matches['value'] : $matches[3]; if (array_search($key, array('DB_HOST', 'DB_RBAC_HOST', 'DB_REPORT_HOST')) !== false) { /* Change the database hostname for these keys */ $value = $this->newHost; @@ -1197,11 +1197,11 @@ class workspaceTools foreach ($metadata->directories as $dir) { CLI::logging("+> Restoring directory '$dir'\n"); - if(file_exists("$tempDirectory/$dir" . "/ee")) { - G::rm_dir("$tempDirectory/$dir" . "/ee"); - } - if(file_exists("$tempDirectory/$dir" . "/plugin.singleton")) { - G::rm_dir("$tempDirectory/$dir" . "/plugin.singleton"); + if(file_exists("$tempDirectory/$dir" . "/ee")) { + G::rm_dir("$tempDirectory/$dir" . "/ee"); + } + if(file_exists("$tempDirectory/$dir" . "/plugin.singleton")) { + G::rm_dir("$tempDirectory/$dir" . "/plugin.singleton"); } if (!rename("$tempDirectory/$dir", $workspace->path)) { throw new Exception("There was an error copying the backup files ($tempDirectory/$dir) to the workspace directory {$workspace->path}.");