Commit c07c6613 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#575796 by Heine: our OpenID XRI test violated the specification; we should...

#575796 by Heine: our OpenID XRI test violated the specification; we should strip the xri:// prefix and look for an XRI global context symbol
parent 4b87ae18
......@@ -74,11 +74,14 @@ function openid_redirect_form(&$form_state, $url, $message) {
* Determine if the given identifier is an XRI ID.
*/
function _openid_is_xri($identifier) {
$firstchar = substr($identifier, 0, 1);
if ($firstchar == "@" || $firstchar == "=")
return TRUE;
// Strip the xri:// scheme from the identifier if present.
if (stripos($identifier, 'xri://') !== FALSE) {
$identifier = substr($identifier, 6);
}
if (stristr($identifier, 'xri://') !== FALSE) {
// Test whether the identifier starts with an XRI global context symbol or (.
$firstchar = substr($identifier, 0, 1);
if (strpos("=@+$!(", $firstchar) !== FALSE) {
return TRUE;
}
......
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