v4.3.1: Bug in site_url() ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: v4.3.1: Bug in site_url() ? (/showthread.php?tid=86549) |
v4.3.1: Bug in site_url() ? - lone_wolf - 02-01-2023 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/helpers/url_helper.html#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. RE: v4.3.1: Bug in site_url() ? - kenjis - 02-01-2023 I have confirmed this bug. Please try: https://github.com/codeigniter4/CodeIgniter4/pull/7211 RE: v4.3.1: Bug in site_url() ? - lone_wolf - 02-02-2023 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? RE: v4.3.1: Bug in site_url() ? - kenjis - 02-07-2023 We have changed. See https://github.com/codeigniter4/CodeIgniter4/pull/7215 |