Welcome Guest, Not a member yet? Register   Sign In
v4.3.1: Bug in site_url() ?
#1

Hello CI community,

first of all, thanks for your effort, you put into this great framework. I love using it. :-)

After the update from v4.2.12 to v4.3.1, there is a strange behavior with the url helper "site_url()".

In Config/App.php I set the hostname of my site: www.mydomain.com
Then I created Config/AppEvents.php with the hostname events.mydomain.com

And according to the documentation (https://codeigniter.com/user_guide/helpe...l#site_url), it is possible to set a third parameter for an alternate configuration.

So I did this: site_url('coolurl/eventname/whatever', null, config('AppEvents'))
And in v4.2 the result was "https://events.mydomain.com/coolurl/eventname/whatever". That worked so far.
But in v4.3 the result is "https://www.mydomain.com/coolurl/eventname/whatever".
So it seems that the alternate configuration is not used anymore.

Did I miss aynthing? I'm deeply confused. :-D

Any help would be appreciated. Thanks in advance.
Reply
#2

(This post was last modified: 02-01-2023, 07:46 PM by kenjis.)

I have confirmed this bug.

Please try:
https://github.com/codeigniter4/CodeIgniter4/pull/7211
Reply
#3

Thanks for the fast help. Your solution works. :-)
Is it best practice, if I implement your solution as a custom helper (app folder), that overrides the default helper methods? Or should I wait until a new release comes out?
What do you recommend?
Reply
#4

We have changed.
See https://github.com/codeigniter4/CodeIgniter4/pull/7215
Reply




Theme © iAndrew 2016 - Forum software by © MyBB