Commit 63135473 authored by Dries's avatar Dries
Browse files

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

parent b8389ebd
...@@ -24,8 +24,8 @@ function language_initialize() { ...@@ -24,8 +24,8 @@ function language_initialize() {
case LANGUAGE_NEGOTIATION_DOMAIN: case LANGUAGE_NEGOTIATION_DOMAIN:
foreach ($languages as $language) { foreach ($languages as $language) {
$parts = parse_url($language->domain); $host = parse_url($language->domain, PHP_URL_HOST);
if (!empty($parts['host']) && ($_SERVER['HTTP_HOST'] == $parts['host'])) { if ($host && ($_SERVER['HTTP_HOST'] == $host)) {
return $language; return $language;
} }
} }
......
...@@ -285,8 +285,8 @@ function openid_discovery($claimed_id) { ...@@ -285,8 +285,8 @@ function openid_discovery($claimed_id) {
if (_openid_is_xri($claimed_id)) { if (_openid_is_xri($claimed_id)) {
$xrds_url = 'http://xri.net/' . $claimed_id; $xrds_url = 'http://xri.net/' . $claimed_id;
} }
$url = @parse_url($xrds_url); $scheme = @parse_url($xrds_url, PHP_URL_SCHEME);
if ($url['scheme'] == 'http' || $url['scheme'] == 'https') { if ($scheme == 'http' || $scheme == 'https') {
// For regular URLs, try Yadis resolution first, then HTML-based discovery // For regular URLs, try Yadis resolution first, then HTML-based discovery
$headers = array('Accept' => 'application/xrds+xml'); $headers = array('Accept' => 'application/xrds+xml');
$result = drupal_http_request($xrds_url, array('headers' => $headers)); $result = drupal_http_request($xrds_url, array('headers' => $headers));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment