File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,12 +28,13 @@ public function checkPassword($uid, $password) {
2828 * Connect without user/name password to make sure
2929 * URL is indeed authenticating or not...
3030 */
31- stream_context_set_default (array (
32- 'http ' =>array (
33- 'method ' =>"GET " ,
31+ $ context = stream_context_create (array (
32+ 'http ' => array (
33+ 'method ' => "GET " ,
34+ 'follow_location ' => 0
3435 ))
3536 );
36- $ canary = get_headers ($ this ->authUrl , 1 );
37+ $ canary = get_headers ($ this ->authUrl , 1 , $ context );
3738 if (!$ canary ) {
3839 OC ::$ server ->getLogger ()->error (
3940 'ERROR: Not possible to connect to BasicAuth Url: ' .$ this ->authUrl ,
@@ -49,13 +50,14 @@ public function checkPassword($uid, $password) {
4950 return false ;
5051 }
5152
52- stream_context_set_default (array (
53- 'http ' =>array (
54- 'method ' =>"GET " ,
55- 'header ' => "authorization: Basic " . base64_encode ("$ uid: $ password " )
53+ $ context = stream_context_create (array (
54+ 'http ' => array (
55+ 'method ' => "GET " ,
56+ 'header ' => "authorization: Basic " . base64_encode ("$ uid: $ password " ),
57+ 'follow_location ' => 0
5658 ))
5759 );
58- $ headers = get_headers ($ this ->authUrl , 1 );
60+ $ headers = get_headers ($ this ->authUrl , 1 , $ context );
5961
6062 if (!$ headers ) {
6163 OC ::$ server ->getLogger ()->error (
You can’t perform that action at this time.
0 commit comments