8000 [Routing] Fix the matching process by vicb · Pull Request #4170 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Fix the matching process #4170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2012
Merged

Conversation

vicb
Copy link
Contributor
@vicb vicb commented May 1, 2012

This PR is based on the PR #3678, #4139.

Build Status

The spec

A pattern is composed of both text and variable segments: /{variable}-test/{other_variable}.

A variable segment will match anything until a separator is encountered. The separator is the character following the variable segment when available or preceding the variable otherwise (i.e. at the end of the pattern).

That is:

  • the separator is - for the variable,
  • the separator is / for the other_variable.

Note: This default matching behavior can be overridden if a requirement is specified for a variable)

Fixes

  • The current behavior is to consider booth the preceding and following characters as separators (considering availability),
  • The "preceding" separator of the first variable is always set to / whatever the preceding character is (due to $pos = 0 for the first iteration).

Todo

Update the doc once this is merged

fabpot added a commit that referenced this pull request May 7, 2012
Commits
-------

a196ca0 [Routing] Compiler: remove lazy quantifiers with no effect
8232aa1 [Routing] Compiler: fix in the computing of the segment separators

Discussion
----------

[Routing] Fix the matching process

This PR is based on the PR #3678, #4139.

[![Build Status](https://secure.travis-ci.org/vicb/symfony.png?branch=routingmatcher)](http://travis-ci.org/vicb/symfony)

**The spec**

A pattern is composed of both text and variable segments: `/{variable}-test/{other_variable}`.

A variable segment will match anything until a separator is encountered. The separator is the character following the variable segment when available or preceding the variable otherwise (i.e. at the end of the pattern).

That is:

* the separator is `-` for the `variable`,
* the separator is `/` for the `other_variable`.

*Note: This default matching behavior can be overridden if a requirement is specified for a variable)*

**Fixes**

* The current behavior is to consider booth the preceding and following characters as separators (considering availability),
* The "preceding" separator of the first variable is always set to `/` whatever the preceding character is (due to `$pos = 0` for the first iteration).

**Todo**

Update the doc once this is merged
@fabpot fabpot merged commit a196ca0 into symfony:master May 7, 2012
vicb added a commit to vicb/symfony that referenced this pull request May 7, 2012
fabpot added a commit that referenced this pull request May 7, 2012
Commits
-------

9907df2 [Routing] Fix a regression introduced by #4170

Discussion
----------

[Routing] Fix a regression introduced by #4170

See 8232aa1#commitcomment-1300310

Let's wait to confirm the fix is ok before merging

@stephpy, @mvrhov ?

(Travis is not ok since 5.3.3 is not supported).

---------------------------------------------------------------------------

by stephpy at 2012-05-07T16:17:44Z

Yes it's OK !

Thanks :)

---------------------------------------------------------------------------

by Tobion at 2012-05-07T16:20:38Z

So your originally proposed spec is not the same anymore.

---------------------------------------------------------------------------

by vicb at 2012-05-07T16:22:38Z

@Tobion

* fixed.
* no it is not as it couldn't work in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0