Skip to content

Bug: site_url() ignores Config\App::$baseURL when not passing $config #7290

@c4user

Description

@c4user

PHP Version

7.4

CodeIgniter4 Version

4.3.2

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.2

What happened?

site_url() function ignores App->baseURL

Steps to Reproduce

Change config("App")->baseURL and check site_url("test") output.

// default baseURL = "http://localhost:8080/";
$app = config("App");
$app->baseURL = "https://test.com/";

return site_url("/login"); // output: http://localhost:8080/login

Expected Output

Output containing the new baseURL (https://test.com/login).

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for infoIssues or pull requests that need further clarification from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions