From 6ee6a95622bba50cf33c5f1add83ff4fe8c8e35a Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Fri, 23 Aug 2024 15:04:48 +0200 Subject: [PATCH] Move the ?? into system/Core/Config.php to do not fail if the local_url config entry is missing. --- system/core/Config.php | 2 +- system/helpers/url_helper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/core/Config.php b/system/core/Config.php index 245f44bb2..761441233 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -335,7 +335,7 @@ class CI_Config { */ public function local_url($uri = '', $protocol = NULL) { - $local_url = $this->slash_item('local_url'); + $local_url = $this->slash_item('local_url') ?? $this->slash_item('base_url'); if (isset($protocol)) { // For protocol-relative links diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 89e90b588..8b2eb1806 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -106,7 +106,7 @@ if ( ! function_exists('local_url')) function local_url($uri = '', $protocol = NULL) { - return get_instance()->config->local_url($uri, $protocol) ?? get_instance()->config->base_url($uri, $protocol); + return get_instance()->config->local_url($uri, $protocol); } }