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
If I define a route that has 2 request parameters that start with the same string, Moor will fail to route properly.
Examples :
Moor::route('/:api/:model/:practices_id/:model_id/', function() // This fails
Moor::route('/:api/:model/:practices_id(\d+)/:models_id(\d+)/', function() // This fails
Moor::route('/:api/:model/:practices_id(\d+)/:the_models_id(\d+)/', function() // This works!!!!
Notice how the second parameter for all of these is ":model". In the first 2 examples, the 4th parameter starts with ":model". Each of these instances will cause moor to not route. In the third example, the 4th paraments contains "model" but it does not START with "model". Because of this, the fourth example routes properly.
If I dump the $url object in parseUrl(), I get the following "pattern" when the 2nd and 4th paraments contain "model":
Notice how the [pattern] property has replaced my "model_id" with just "model" in the 4th parameter? This of course conflicts with the first instance of "model" in the 2nd parameter.
For now, the work around is to know have any parameter names that start with the same letters.
The text was updated successfully, but these errors were encountered:
There appears to be a bug in Moor.php parseUrl().
If I define a route that has 2 request parameters that start with the same string, Moor will fail to route properly.
Examples :
Notice how the second parameter for all of these is ":model". In the first 2 examples, the 4th parameter starts with ":model". Each of these instances will cause moor to not route. In the third example, the 4th paraments contains "model" but it does not START with "model". Because of this, the fourth example routes properly.
If I dump the $url object in parseUrl(), I get the following "pattern" when the 2nd and 4th paraments contain "model":
Notice how the [pattern] property has replaced my "model_id" with just "model" in the 4th parameter? This of course conflicts with the first instance of "model" in the 2nd parameter.
For now, the work around is to know have any parameter names that start with the same letters.
The text was updated successfully, but these errors were encountered: