You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a filter named 'Localize' in my CI4 app. In the before() function I call getSegments() on the request object. If I go to a URL containing some segments, like domain.com/fr or domain.com/fr/blog it work as expected. getTotalSegments will return 1 or 2, and getSegments will return an array with 'fr' or with 'fr and 'blog'.
The problem is when I go to the root of the website (domain.com), getTotalSegments will return 2 and getSegments will return an array containing 2 empty string:
I have created a filter named 'Localize' in my CI4 app. In the before() function I call getSegments() on the request object. If I go to a URL containing some segments, like domain.com/fr or domain.com/fr/blog it work as expected. getTotalSegments will return 1 or 2, and getSegments will return an array with 'fr' or with 'fr and 'blog'.
The problem is when I go to the root of the website (domain.com), getTotalSegments will return 2 and getSegments will return an array containing 2 empty string:
This is with CodeIgniter 4.0.2, PHP 7.4.2, Apache server (MAMP) on macOS.
Expected behavior would be 0 segments for URI /
The text was updated successfully, but these errors were encountered: