Commit 108011af authored by Dries's avatar Dries
Browse files

- Patch #756498 by douggreen: restore current directory after...

- Patch #756498 by douggreen: restore current directory after register_shutdown_function() callback.
parent d35cf3f3
......@@ -2673,7 +2673,7 @@ function &drupal_register_shutdown_function($callback = NULL, $parameters = NULL
$args = func_get_args();
array_shift($args);
// Save callback and arguments
$callbacks[] = array('callback' => $callback, 'arguments' => $args);
$callbacks[] = array('callback' => $callback, 'arguments' => $args, 'cwd' => getcwd());
}
return $callbacks;
}
......@@ -2686,6 +2686,7 @@ function _drupal_shutdown_function() {
try {
while (list($key, $callback) = each($callbacks)) {
chdir($callback['cwd']);
call_user_func_array($callback['callback'], $callback['arguments']);
}
}
......
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