Routing error since 4.1
Hi! There is a project route rule: 'preset/{id}.{ext}' and this url: '/preset/1.jpg' In the case of laravel 4.0 segment {id} is equal to "1" And laravel 4.1 segment {id} equals "1.j". It looks like a bug.
In the meantime you can add a route constraint to your id parameter so that it only matches [0-9]
@Anahkiasen, your solution is just a monkey patch. Laravel 4.1 breaks back compatability. And i see no sign of this in release docs
@xbagir while I agree with you being that it does sound like a monkey patch; realistically I would expect Route::pattern('id', '[0-9]+'); to be used in any case, which might be why I haven't noticed this bug :)
As the route is probably turned into a regex, the dot will match everything, not just a dot. One way to fix this could be turning the regex generated from {id} to be non-greedy by default.
@xbagir Could you please test whether this patch fixes the issue for you? If it does, I'll send a pull request.
@franzliedke Checked. The patch fixes the problem, thanks!
Oh, can you please check that it works with a two-digit ID, too?
@franzliedke No, it only works with single digit.
Darn, I was afraid that would happen. I'll write some tests and come up with a proper fix.
Sent a PR. Test-driven bug fixing is cool. :)
Fixed.