![]() |
Hi,
I updated CI4 from 4.3.5 to 4.4.8. Since I have a problem with base_url(). In the controller called by https://site.com, base_url() gives the correct information. In the controller called by https://site.com/app/logs for example, base_url() falls in error " Unable to parse https://" : Trace:
Any idea ? Thank you in advance (09-18-2024, 03:47 AM)talu Wrote: In the controller called by https://site.com/app/logs for example, base_url() falls in error " Unable to parse https://" : I don't know why, but "https://" is not a valid URL. So no wonder that CI4 is not able to parse. Check why the URI is "https://".
I found the root cause of the problem.
The management of URIs is different between the CI versions.
Hi @talu , would you be willing to share the details? I seem to be encountering similar issue (https://forum.codeigniter.com/showthread.php?tid=91814) and your solution might just help me out.
Thanks in advance!
Hi Jan,
My problem came from this code (loginfilter with Myth library) : PHP Code: public function before(RequestInterface $request, $params = null) I replaced the code by this : PHP Code: public function before(RequestInterface $request, $params = null) I hope that's helpful.
Hi,
I am having almost the same problem. I upgraded from 4.0 to 4.5. I understand that there was a serious change in handling URI in 4.4. My problem is, I used to extend the URI class, and in Services, in the uri() function, I have: return new \App\Libraries\EXT_URI($uri); EXT_URI is a class extending URI. It used to work. But now CI 4.4 and up says that $uri = service('uri'); // returns the current SiteURI instance. I have a lot of mess with base_url() and such. I tried to extend the new class SiteURI instead and return the extended one in service, but it gives a fatal error: Fatal error: Uncaught TypeError: CodeIgniter\HTTP\SiteURI::__construct(): Argument #1 ($configApp) must be of type Config\App, null given Sorry if it deviates from the original thread but I think it's related. I understand that there is a big change in 4.4 but I haven't found any how to update. |
Welcome Guest, Not a member yet? Register Sign In |