Fix parsing of regex route within namespace #41

Merged
merged 1 commit into from May 17, 2012

Conversation

Projects
None yet
2 participants
Contributor

abackstrom commented May 9, 2012

Modify parsing of regex routes within namespaces:

  1. Prepend the namespace to all regexes
  2. Interpret circumflex (^) anchor appropriately in relation to namespace
  3. Ensure that negation only matches hits within the namespace

See #40 for original issue and test code.

Slightly wonky aspect of this: the prepending slash.

<?php

with( '/path', function(){
    respond( '@foo', $cb ); // matches /path/foo, /pathfoo, /pathfood, /path/hoofoot
    respond( '@^foo', $cb ); // matches /pathfoo, /pathfood
    respond( '@^/foo', $cb ); // matches /path/foo, /path/food
});
Owner

abackstrom commented on klein.php in 5cb2bb5 May 9, 2012

== should have been ===, per code already in dispatch().

Collaborator

chriso commented May 17, 2012

Thanks. The namespace functionality was a tad rushed.

@chriso chriso added a commit that referenced this pull request May 17, 2012

@chriso chriso Merge pull request #41 from abackstrom/route-namespace-regex
Fix parsing of regex route within namespace
8b7adac

@chriso chriso merged commit 8b7adac into klein:master May 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment