diff --git a/github-api.php b/github-api.php index 92a3b43..92e894b 100644 --- a/github-api.php +++ b/github-api.php @@ -150,7 +150,7 @@ class github_api { $this->log( "get_repo_milestone_summary( $owner, $repository, $milestone )", GEDEBUG_CALL ); $owner = trim( $owner, '/' ); - $repo = trim( $repo, '/' ); + $repo = trim( $repository, '/' ); $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/milestones/$milestone" ); diff --git a/github-embed.php b/github-embed.php index d2ba291..2b37c88 100644 --- a/github-embed.php +++ b/github-embed.php @@ -207,6 +207,11 @@ class github_embed { $this->oembed_github_repo_milestone_summary ( $matches[1], $matches[2], $milestone ); } + // New style milestone URL, e.g. https://github.com/example/example/milestone/1 + } elseif ( preg_match ( '#https?://github.com/([^/]*)/([^/]*)/milestone/([0-9]*)$#i', $url, $matches ) ) { + + $this->oembed_github_repo_milestone_summary( $matches[1], $matches[2], $matches[3] ); + // Repository } elseif ( preg_match ( '#https?://github.com/([^/]*)/([^/]*)/?$#i', $url, $matches ) && ! empty ( $matches[2] ) ) {