FriendsOfSymfony / FOSJsRoutingBundle

A pretty nice way to expose your Symfony routing to client applications.
1.48k stars 261 forks source link

Expose domains broken regex pattern #349

Closed onEXHovia closed 5 years ago

onEXHovia commented 5 years ago

After upgrading to version 2.3.0 not all route fall into the final list. With a quick check, the regular expression pattern gives out incorrect matches https://github.com/FriendsOfSymfony/FOSJsRoutingBundle/blob/master/Extractor/ExposedRoutesExtractor.php#L90.

For example https://regex101.com/r/pYNG46/2 route mh_user_social_render must be fully matched and not partially.

ping @tugrul @tobias-93

tugrul commented 5 years ago

I think this is ok by the example: https://regex101.com/r/pYNG46/3

zerkms commented 5 years ago

The v2.3.0 definitely breaks the routes_to_expose. One possible workaround is to use regular expressions and specify every exposed route name with beginning and end of string anchors, eg ^mh_user_social_render$.

aeyoll commented 5 years ago

Hello. PR #350 is indeed fixing this issue. Can a maintainer review it and merge it if it's ok? Thanks a lot!

tobias-93 commented 5 years ago

It is merged, sorry for the delay.

aeyoll commented 5 years ago

Thanks a lot @tobias-93! Can you do a new release on packagist? That would be great, thank you!

tobias-93 commented 5 years ago

@aeyoll version 2.3.1 has just been released.