function _openid_meta_httpequiv

Pull the content attribute out of an X-XRDS-Location meta http-equiv element.

1 call to _openid_meta_httpequiv()
_openid_xrds_discovery in drupal/core/modules/openid/openid.module
OpenID discovery method: perform a XRDS discovery.

File

drupal/core/modules/openid/openid.inc, line 405
OpenID utility functions.

Code

function _openid_meta_httpequiv($html) {
  $html_dom = new DOMDocument();
  if (@$html_dom
    ->loadHTML($html)) {
    $html_element = simplexml_import_dom($html_dom);
    if (isset($html_element->head->meta)) {
      foreach ($html_element->head->meta as $meta) {

        // The http-equiv attribute is case-insensitive.
        if (strtolower(trim($meta['http-equiv'])) == 'x-xrds-location') {
          return trim($meta['content']);
        }
      }
    }
  }
  return FALSE;
}