Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Github: Fix PHP system notices

- Undefined index: hub_app_access_token in api_uri()
  ==> added isset() check
- Undefined property: stdClass::$id in json_commit_changeset()
  ==> use 'sha' instead of 'id'
  • Loading branch information...
commit 04d4348f5b9b5d2d6c3269d744ea2cfde21e3fef 1 parent 39b3ca8
Damien Regad dregad authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 SourceGithub/SourceGithub.php
10 SourceGithub/SourceGithub.php
View
@@ -170,9 +170,11 @@ public function update_repo( $p_repo ) {
private function api_uri( $p_repo, $p_path ) {
$t_uri = 'https://api.github.com/' . $p_path;
- $t_access_token = $p_repo->info['hub_app_access_token'];
- if ( !is_blank( $t_access_token ) ) {
- $t_uri .= '?access_token=' . $t_access_token;
+ if( isset( $p_repo->info['hub_app_access_token'] ) ) {
+ $t_access_token = $p_repo->info['hub_app_access_token'];
+ if ( !is_blank( $t_access_token ) ) {
+ $t_uri .= '?access_token=' . $t_access_token;
+ }
}
return $t_uri;
@@ -349,7 +351,7 @@ public function import_commits( $p_repo, $p_commit_ids, $p_branch='' ) {
private function json_commit_changeset( $p_repo, $p_json, $p_branch='' ) {
- echo "processing $p_json->id ... ";
+ echo "processing $p_json->sha ... ";
if ( !SourceChangeset::exists( $p_repo->id, $p_json->sha ) ) {
$t_parents = array();
foreach( $p_json->parents as $t_parent ) {
Please sign in to comment.
Something went wrong with that request. Please try again.