- Patch #366949 by c960657: use parse_url(, PHP_URL_xxx).

merge-requests/26/head
Dries Buytaert 2009-02-01 16:45:53 +00:00
parent b8389ebd54
commit 631354733a
2 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,8 @@ function language_initialize() {
case LANGUAGE_NEGOTIATION_DOMAIN:
foreach ($languages as $language) {
$parts = parse_url($language->domain);
if (!empty($parts['host']) && ($_SERVER['HTTP_HOST'] == $parts['host'])) {
$host = parse_url($language->domain, PHP_URL_HOST);
if ($host && ($_SERVER['HTTP_HOST'] == $host)) {
return $language;
}
}

View File

@ -285,8 +285,8 @@ function openid_discovery($claimed_id) {
if (_openid_is_xri($claimed_id)) {
$xrds_url = 'http://xri.net/' . $claimed_id;
}
$url = @parse_url($xrds_url);
if ($url['scheme'] == 'http' || $url['scheme'] == 'https') {
$scheme = @parse_url($xrds_url, PHP_URL_SCHEME);
if ($scheme == 'http' || $scheme == 'https') {
// For regular URLs, try Yadis resolution first, then HTML-based discovery
$headers = array('Accept' => 'application/xrds+xml');
$result = drupal_http_request($xrds_url, array('headers' => $headers));