Skip to content

Commit

Permalink
Support for older version of PCRE
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Apr 17, 2011
1 parent a078cb7 commit 79dcdeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion klein.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ function compile_route($route) {
if ($pre === '.') {
$pre = '\.';
}
//Older versions of PCRE require the 'P' in (?P<named>)
$pattern = '(?:'
. ($pre !== '' ? $pre : null)
. '('
. ($param !== '' ? "?<$param>" : null)
. ($param !== '' ? "?P<$param>" : null)
. $type
. '))'
. ($optional !== '' ? '?' : null);
Expand Down

0 comments on commit 79dcdeb

Please sign in to comment.