diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index c82dbf6..eeb7ec2 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -121,9 +121,11 @@ # Once it reaches here it is decoded. Hence we split by a space # were as the curl command uses a '+' character instead. # i.e. DATA=`echo $INPUT | sed -e 's/ /+/g'` - list ( , $t_commit_id, $t_branch) = split(' ', $p_data); - list ( , , $t_branch) = split('/', $t_branch); - if ($t_branch != $p_repo->info['master_branch']) + list ( , $t_commit_id, $t_branch) = explode(' ', $p_data); + list ( , , $t_branch) = explode('/', $t_branch); + # master_branch contains comma-separated list of branches + $t_branches = explode(',', $p_repo->info['master_branch']); + if (!in_array($t_branch, $t_branches)) { return; }