normalize identifiers when comparing them
authorChristian Weiske <cweiske@cweiske.de>
Fri, 17 Oct 2014 23:50:47 +0000 (01:50 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 17 Oct 2014 23:50:47 +0000 (01:50 +0200)
www/index.php

index 496d7d3bbede3e1bd271971a036ce511e03ca419..c3b784856dc7c0058931ecae8f3682f804d8eea0 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 require_once 'Net/URL2.php';
  */
 
 require_once 'Net/URL2.php';
+require_once 'OpenID.php';
 require_once 'OpenID/RelyingParty.php';
 require_once 'OpenID/Message.php';
 require_once 'OpenID/Exception.php';
 require_once 'OpenID/RelyingParty.php';
 require_once 'OpenID/Message.php';
 require_once 'OpenID/Exception.php';
@@ -139,7 +140,7 @@ if (isset($_GET['openid_mode']) && $_GET['openid_mode'] != '') {
 
     $message = new \OpenID_Message($queryString, \OpenID_Message::FORMAT_HTTP);
     $id      = $message->get('openid.claimed_id');
 
     $message = new \OpenID_Message($queryString, \OpenID_Message::FORMAT_HTTP);
     $id      = $message->get('openid.claimed_id');
-    if ($id != $_SESSION['me']) {
+    if (OpenID::normalizeIdentifier($id) != OpenID::normalizeIdentifier($_SESSION['me'])) {
         error(
             sprintf(
                 'Given identity URL "%s" and claimed OpenID "%s" do not match',
         error(
             sprintf(
                 'Given identity URL "%s" and claimed OpenID "%s" do not match',