_openid_is_xri

Versions
6 – 7
_openid_is_xri($identifier)

Determine if the given identifier is an XRI ID.

▾ 2 functions call _openid_is_xri()

openid_discovery in modules/openid/openid.module
Perform discovery on a claimed ID to determine the OpenID provider endpoint.
_openid_normalize in modules/openid/openid.inc
Normalize the given identifier as per spec.

Code

modules/openid/openid.inc, line 75

<?php
function _openid_is_xri($identifier) {
  // Strip the xri:// scheme from the identifier if present.
  if (stripos($identifier, 'xri://') !== FALSE) {
    $identifier = substr($identifier, 6);
  }

  // Test whether the identifier starts with an XRI global context symbol or (.
  $firstchar = substr($identifier, 0, 1);
  if (strpos("=@+$!(", $firstchar) !== FALSE) {
    return TRUE;
  }

  return FALSE;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.