Router interprets negative integer values of a match result as "matched"
The DynamicRoutPart::match() method doesn't do strict comparison of the route's return value and therefore wrongly interprets integer values such as "-1" as TRUE. This leads to the route part handlers to match although they don't.
Updated by Bastian Waidelich about 11 years ago
Robert Lemke wrote:
Hi, I have a little remark here:
The DynamicRoutPart::match() [...] wrongly interprets integer values such as "-1" as TRUE.
RoutePartHandler must implement F3\FLOW3\MVC\Web\Routing\RoutePartInterface. It's match() method should always return a boolean (and the default DynamicRoutPart does).
So if DynamicRoutPart::match() returns "-1", that is actually a mistake in the respective route part handler. The same thing for Route:matches(). But I guess, we still want to "fix" this in the calling code, right?
BTW: the fix isn't covered by a unit test ;) should I provide one?