diff --git a/core/authorize.php b/core/authorize.php index fe374fa..8118f46 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -127,13 +127,8 @@ function authorize_access_allowed(Request $request) { // Since this is being called outsite of the primary front controller, // the base_url needs to be set explicitly to ensure that links are // relative to the site root. - // @todo Simplify with https://www.drupal.org/node/2548095 $default_options = [ '#type' => 'link', - '#options' => [ - 'absolute' => TRUE, - 'base_url' => $GLOBALS['base_url'], - ], ]; $links = [ $default_options + [ diff --git a/core/lib/Drupal/Core/Routing/RequestContext.php b/core/lib/Drupal/Core/Routing/RequestContext.php index c5222c4..93cd31b 100644 --- a/core/lib/Drupal/Core/Routing/RequestContext.php +++ b/core/lib/Drupal/Core/Routing/RequestContext.php @@ -55,7 +55,7 @@ public function fromRequest(Request $request) { $this->setCompleteBaseUrl($GLOBALS['base_url']); } if (isset($GLOBALS['base_path'])) { - $this->setMainBaseUrl('/' . ltrim($GLOBALS['base_path'])); + $this->setMainBaseUrl('/' . trim($GLOBALS['base_path'], '/')); } } @@ -69,7 +69,7 @@ public function getMainBaseUrl() { } /** - * Sts the main base URL for the request context. + * Sets the main base URL for the request context. * * @param string $main_base_url * The main base URL. diff --git a/core/lib/Drupal/Core/Updater/Module.php b/core/lib/Drupal/Core/Updater/Module.php index 00d51e3..782b53e 100644 --- a/core/lib/Drupal/Core/Updater/Module.php +++ b/core/lib/Drupal/Core/Updater/Module.php @@ -112,13 +112,8 @@ public function postInstallTasks() { // Since this is being called outsite of the primary front controller, // the base_url needs to be set explicitly to ensure that links are // relative to the site root. - // @todo Simplify with https://www.drupal.org/node/2548095 $default_options = [ '#type' => 'link', - '#options' => [ - 'absolute' => TRUE, - 'base_url' => $GLOBALS['base_url'], - ], ]; return [ $default_options + [ diff --git a/core/lib/Drupal/Core/Updater/Theme.php b/core/lib/Drupal/Core/Updater/Theme.php index bcf88c6..4d9af4e 100644 --- a/core/lib/Drupal/Core/Updater/Theme.php +++ b/core/lib/Drupal/Core/Updater/Theme.php @@ -95,13 +95,8 @@ public function postInstallTasks() { // Since this is being called outsite of the primary front controller, // the base_url needs to be set explicitly to ensure that links are // relative to the site root. - // @todo Simplify with https://www.drupal.org/node/2548095 $default_options = [ '#type' => 'link', - '#options' => [ - 'absolute' => TRUE, - 'base_url' => $GLOBALS['base_url'], - ], ]; return [ $default_options + [ diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc index b96c904..f3b3b4b 100644 --- a/core/modules/update/update.authorize.inc +++ b/core/modules/update/update.authorize.inc @@ -255,11 +255,6 @@ function update_authorize_update_batch_finished($success, $results) { // Since this is being called outsite of the primary front controller, // the base_url needs to be set explicitly to ensure that links are // relative to the site root. - // @todo Simplify with https://www.drupal.org/node/2548095 - '#options' => [ - 'absolute' => TRUE, - 'base_url' => $GLOBALS['base_url'], - ], ]; // Unset the variable since it is no longer needed.