Skip to content

Commit 0f9f384

Browse files
authored
Small fix for anchor function
Fixes function "anchor" not updating the hostname even when it is set in Config\App::$allowedHostnames and when the current URL matches.
1 parent 0611c35 commit 0f9f384

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

system/Helpers/url_helper.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,8 @@ function index_page(?App $altConfig = null): string
150150
* @param array|object|string $attributes Any attributes
151151
* @param App|null $altConfig Alternate configuration to use
152152
*/
153-
function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig = null): string
153+
function anchor($uri = '', string $title = '', $attributes = '', ?App $config = null): string
154154
{
155-
// use alternate config if provided, else default one
156-
$config = $altConfig ?? config(App::class);
157-
158155
$siteUrl = is_array($uri) ? site_url($uri, null, $config) : (preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri, null, $config));
159156
// eliminate trailing slash
160157
$siteUrl = rtrim($siteUrl, '/');

0 commit comments

Comments
 (0)