Move the ?? into system/Core/Config.php to do not fail if the local_url config entry is missing.

This commit is contained in:
Patrick Winnertz
2024-08-23 15:04:48 +02:00
parent 2316331bea
commit 6ee6a95622
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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);
}
}