Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 3897... Línea 3897...
3897
                    }
3897
                    }
3898
                }
3898
                }
Línea 3899... Línea 3899...
3899
 
3899
 
Línea -... Línea 3900...
-
 
3900
                curl_setopt($curl, CURLOPT_URL, $redirecturl);
-
 
3901
 
3900
                curl_setopt($curl, CURLOPT_URL, $redirecturl);
3902
                // If CURLOPT_UNRESTRICTED_AUTH is empty/false, don't send credentials to other hosts.
-
 
3903
                // Ref: https://curl.se/libcurl/c/CURLOPT_UNRESTRICTED_AUTH.html.
-
 
3904
                $isdifferenthost = parse_url($currenturl)['host'] !== parse_url($redirecturl)['host'];
3901
 
3905
                $sendauthentication = !empty($this->options['CURLOPT_UNRESTRICTED_AUTH']);
3902
                if (parse_url($currenturl)['host'] !== parse_url($redirecturl)['host']) {
3906
                if ($isdifferenthost && !$sendauthentication) {
-
 
3907
                    curl_setopt($curl, CURLOPT_HTTPAUTH, null);
-
 
3908
                    curl_setopt($curl, CURLOPT_USERPWD, null);
-
 
3909
                    // Check whether the CURLOPT_HTTPHEADER is specified.
-
 
3910
                    if (!empty($this->options['CURLOPT_HTTPHEADER'])) {
-
 
3911
                        // Remove the "Authorization:" header, if any.
-
 
3912
                        $headerredirect = array_filter(
-
 
3913
                            $this->options['CURLOPT_HTTPHEADER'],
-
 
3914
                            fn($header) => strpos($header, 'Authorization:') === false
-
 
3915
                        );
3903
                    curl_setopt($curl, CURLOPT_HTTPAUTH, null);
3916
                        curl_setopt($curl, CURLOPT_HTTPHEADER, $headerredirect);
Línea 3904... Línea 3917...
3904
                    curl_setopt($curl, CURLOPT_USERPWD, null);
3917
                    }
Línea 3905... Línea 3918...
3905
                }
3918
                }