File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010use CDash \Model \Project ;
1111use CDash \ServiceContainer ;
1212use Illuminate \Support \Facades \Log ;
13+ use Illuminate \Support \Facades \Uri ;
1314use PDO ;
1415
1516class RepositoryUtils
@@ -27,7 +28,7 @@ public static function isGitHubUrl(string $url): bool
2728 }
2829 $ enterpriseUrl = self ::getEnterpriseUrl ();
2930 if ($ enterpriseUrl !== null ) {
30- $ host = parse_url ($ enterpriseUrl, PHP_URL_HOST );
31+ $ host = Uri:: of ($ enterpriseUrl)-> host ( );
3132 return is_string ($ host ) && str_contains ($ url , $ host );
3233 }
3334 return false ;
@@ -167,7 +168,7 @@ public static function get_github_api_url($github_url): string
167168 {
168169 $ enterpriseUrl = self ::getEnterpriseUrl ();
169170 if ($ enterpriseUrl !== null ) {
170- $ host = parse_url ($ enterpriseUrl, PHP_URL_HOST );
171+ $ host = Uri:: of ($ enterpriseUrl)-> host ( );
171172 if (is_string ($ host )) {
172173 $ idx = strpos ($ github_url , $ host );
173174 if ($ idx !== false ) {
You can’t perform that action at this time.
0 commit comments