Skip to content

Commit 710d32f

Browse files
committed
GitWeb: use url_get() to retrieve data with basic auth
Fixes #218
1 parent 61d3d21 commit 710d32f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

SourceGitweb/SourceGitweb.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ public function register() {
3434
public function url_get_auth( $p_url, $p_user, $p_pass ) {
3535
if( strlen( $p_user ) > 0 && strlen( $p_pass ) > 0 ) {
3636
$t_url_parts = preg_split("/:\\/\\//", $p_url );
37-
$t_url_with_credentials = $t_url_parts[0] . "://" . $p_user . ":" . $p_pass . "@" .$t_url_parts[1];
38-
return file_get_contents( $t_url_with_credentials );
39-
} else {
40-
return url_get( $p_url );
37+
$p_url = $t_url_parts[0] . "://" . $p_user . ":" . $p_pass . "@" .$t_url_parts[1];
4138
}
39+
return url_get( $p_url );
4240
}
4341

4442
public function show_type() {

0 commit comments

Comments
 (0)