[svn r14054] Make OpenID login independent of trailing slash (if any)

skala
Yannick Warnier 18 years ago
parent 756150f7a8
commit 24a53e7707
  1. 6
      main/inc/local.inc.php

@ -362,11 +362,15 @@ else
$res = openid_complete($_GET);
if($res['status'] == 'success')
{
$id1 = Database::escape_string($res['openid.identity']);
//have another id with or without the final '/'
$id2 = (substr($id1,-1,1)=='/'?substr($id1,0,-1):$id1.'/');
//lookup the user in the main database
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date
FROM $user_table
WHERE openid = '".Database::escape_string($res['openid.identity'])."'";
WHERE openid = '$id1'
OR openid = '$id2' ";
$result = api_sql_query($sql);
if($result !== false)
{

Loading…
Cancel
Save