diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 1184e7b..ca7f6e7 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2987,7 +2987,7 @@ function _current_path($path = NULL) { } /** - * Return the current URL path of the page being viewed. + * Returns the current URL path of the page being viewed. * * Examples: * - http://example.com/node/306 returns "node/306". @@ -2998,13 +2998,13 @@ function _current_path($path = NULL) { * * @return * The current Drupal URL path. - * - * @see request_path() */ function current_path() { if (drupal_container()->isScopeActive('request')) { return drupal_container()->get('request')->attributes->get('system_path'); } + // This function can be called outside of the scope of a request, e.g. from + // run-tests.sh, so fall back to _current_path(). return _current_path(); }