You are here

function _openid_link_href in Drupal 7

Same name and namespace in other branches
  1. 6 modules/openid/openid.inc \_openid_link_href()

Pull the href attribute out of an html link element.

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

File

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

Code

function _openid_link_href($rel, $html) {
  $rel = preg_quote($rel);
  preg_match('|<link\\s+rel=["\'](.*)' . $rel . '(.*)["\'](.*)/?>|iUs', $html, $matches);
  if (isset($matches[3])) {
    preg_match('|href=["\']([^"]+)["\']|iU', $matches[3], $href);
    return trim($href[1]);
  }
  return FALSE;
}