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
Fatal error: Uncaught Error: Typed property Pecee\SimpleRouter\Router::$request must not be accessed before initialization in /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php:221 Stack trace: #0 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(295): Pecee\SimpleRouter\Router->processRoutes() #1 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(337): Pecee\SimpleRouter\Router->loadRoutes() #2 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/SimpleRouter.php(69): #6 {main} thrown in /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php on line 221
The text was updated successfully, but these errors were encountered:
usman342
changed the title
It throwing an error when add // for the domain URL like https://example.com//
It's throwing an error when add // for the domain URL like https://example.com//
Apr 23, 2024
It appears that PHP's inbuilt 'parse_url' method called by the Url() class does not like the extra slashes. parse_url will return the component array if a single '/' is passed but fails with '//', '///', etc. (tested on php 8.3.6)
A quick and dirty work around is to strip consecutive slashes prior to SimpleRouter being loaded (i put this before my include vendor.php etc.)
Indeed this seems to be an issue! Consecutive slashes throw an error.
However, I also wanted the url in the browser's bar to look correct as well, so here's another approach which I'm trying.
Fatal error: Uncaught Error: Typed property Pecee\SimpleRouter\Router::$request must not be accessed before initialization in /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php:221 Stack trace: #0 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(295): Pecee\SimpleRouter\Router->processRoutes() #1 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php(337): Pecee\SimpleRouter\Router->loadRoutes() #2 /vendor/pecee/simple-router/src/Pecee/SimpleRouter/SimpleRouter.php(69): #6 {main} thrown in /vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php on line 221
The text was updated successfully, but these errors were encountered: