Skip to content

Commit 20a6ead

Browse files
committed
Api: colon parameter can be separated by dot [Closes #21]
1 parent 7dadbf9 commit 20a6ead

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Github/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ protected function expandColonParameters($url, array $parameters, array $default
368368
{
369369
$parameters += $defaultParameters;
370370

371-
$url = preg_replace_callback('#(^|/):([^/]+)#', function($m) use ($url, & $parameters) {
371+
$url = preg_replace_callback('#(^|/|\.):([^/.]+)#', function($m) use ($url, & $parameters) {
372372
if (!isset($parameters[$m[2]])) {
373373
throw new MissingParameterException("Missing parameter '$m[2]' for URL path '$url'.");
374374
}

tests/Github/Api.expandColonParameters.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ test(function() {
2828
':a/' => 'A?b=B',
2929
'/:a/' => '/A?b=B',
3030
'/:a/:b/c' => '/A/B/c',
31+
'/:a.:b/c' => '/A.B/c',
32+
'/:a...:b/c' => '/A...B/c',
3133
];
3234

3335
foreach ($urls as $url => $expected) {

0 commit comments

Comments
 (0)