| @@ -103,8 +103,11 @@ | ||
| 103 | 103 | public function get_repo( $owner, $repository ) { |
| 104 | 104 | |
| 105 | 105 | $this->log( "get_repo( $owner, $repository )", GEDEBUG_CALL ); |
| 106 | 106 | |
| 107 | + $owner = trim( $owner, '/' ); | |
| 108 | + $repository = trim( $repository, '/' ); | |
| 109 | + | |
| 107 | 110 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository" ); |
| 108 | 111 | |
| 109 | 112 | return json_decode( $results['body'] ); |
| 110 | 113 | |
| @@ -121,8 +124,11 @@ | ||
| 121 | 124 | public function get_repo_commits( $owner, $repository ) { |
| 122 | 125 | |
| 123 | 126 | $this->log( "get_repo_commits( $owner, $repository )", GEDEBUG_CALL ); |
| 124 | 127 | |
| 128 | + $owner = trim( $owner, '/' ); | |
| 129 | + $repository = trim( $repository, '/' ); | |
| 130 | + | |
| 125 | 131 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/commits" ); |
| 126 | 132 | |
| 127 | 133 | return json_decode( $results['body'] ); |
| 128 | 134 | |
| @@ -140,8 +146,11 @@ | ||
| 140 | 146 | public function get_repo_milestone_summary( $owner, $repository, $milestone ) { |
| 141 | 147 | |
| 142 | 148 | $this->log( "get_repo_milestone_summary( $owner, $repository, $milestone )", GEDEBUG_CALL ); |
| 143 | 149 | |
| 150 | + $owner = trim( $owner, '/' ); | |
| 151 | + $repo = trim( $repository, '/' ); | |
| 152 | + | |
| 144 | 153 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/milestones/$milestone" ); |
| 145 | 154 | |
| 146 | 155 | return json_decode( $results['body'] ); |
| 147 | 156 | |
| @@ -152,8 +161,11 @@ | ||
| 152 | 161 | public function get_repo_contributors( $owner, $repository ) { |
| 153 | 162 | |
| 154 | 163 | $this->log( "get_repo_contributors( $owner, $repository )", GEDEBUG_CALL ); |
| 155 | 164 | |
| 165 | + $owner = trim( $owner, '/' ); | |
| 166 | + $repo = trim( $repository, '/' ); | |
| 167 | + | |
| 156 | 168 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/stats/contributors" ); |
| 157 | 169 | |
| 158 | 170 | return json_decode( $results['body'] ); |
| 159 | 171 | |
| @@ -168,8 +180,10 @@ | ||
| 168 | 180 | */ |
| 169 | 181 | public function get_user( $user ) { |
| 170 | 182 | |
| 171 | 183 | $this->log( "get_user( $user )", GEDEBUG_CALL ); |
| 184 | + | |
| 185 | + $user = trim( $user, '/' ); | |
| 172 | 186 | |
| 173 | 187 | $results = $this->call_api( "https://api.github.com/users/$user" ); |
| 174 | 188 | |
| 175 | 189 | return json_decode( $results['body'] ); |