import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -267,10 +267,14 @@ class Auth_OpenID_Consumer {
$this->session =& $session;
/*
* Keyboard Monkeys modification:
* Assigning the return value of new by reference is deprecated
*/
if ($consumer_cls !== null) {
$this->consumer =& new $consumer_cls($store);
$this->consumer = new $consumer_cls($store);
} else {
$this->consumer =& new Auth_OpenID_GenericConsumer($store);
$this->consumer = new Auth_OpenID_GenericConsumer($store);
}
$this->_token_key = $this->session_key_prefix . $this->_token_suffix;

View File

@ -55,13 +55,10 @@ define('Auth_OpenID_NO_DEFAULT', 'NO DEFAULT ALLOWED');
define('Auth_OpenID_OPENID1_URL_LIMIT', 2047);
// All OpenID protocol fields. Used to check namespace aliases.
global $Auth_OpenID_OPENID_PROTOCOL_FIELDS;
$Auth_OpenID_OPENID_PROTOCOL_FIELDS = array(
'ns', 'mode', 'error', 'return_to', 'contact', 'reference',
'signed', 'assoc_type', 'session_type', 'dh_modulus', 'dh_gen',
'dh_consumer_public', 'claimed_id', 'identity', 'realm',
'invalidate_handle', 'op_endpoint', 'response_nonce', 'sig',
'assoc_handle', 'trust_root', 'openid');
/*
* Keyboard Monkeys modification: global var moved next to its usage
* because it was breaking unit tests
*/
// Global namespace / alias registration map. See
// Auth_OpenID_registerNamespaceAlias.
@ -315,11 +312,19 @@ class Auth_OpenID_NamespaceMap {
function addAlias($namespace_uri, $desired_alias, $implicit=false)
{
// Add an alias from this namespace URI to the desired alias
global $Auth_OpenID_OPENID_PROTOCOL_FIELDS;
// Check that desired_alias is not an openid protocol field as
// per the spec.
/*
* Keyboard Monkeys modification: global var moved next to its usage
* because it was breaking unit tests
*/
$Auth_OpenID_OPENID_PROTOCOL_FIELDS = array(
'ns', 'mode', 'error', 'return_to', 'contact', 'reference',
'signed', 'assoc_type', 'session_type', 'dh_modulus', 'dh_gen',
'dh_consumer_public', 'claimed_id', 'identity', 'realm',
'invalidate_handle', 'op_endpoint', 'response_nonce', 'sig',
'assoc_handle', 'trust_root', 'openid');
if (in_array($desired_alias, $Auth_OpenID_OPENID_PROTOCOL_FIELDS)) {
Auth_OpenID::log("\"%s\" is not an allowed namespace alias",
$desired_alias);

View File

@ -178,7 +178,7 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore {
*/
function isError($value)
{
return PEAR::isError($value);
return false;
}
/**
@ -188,11 +188,7 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore {
*/
function resultToBool($obj)
{
if ($this->isError($obj)) {
return false;
} else {
return true;
}
return true;
}
/**

View File

@ -821,7 +821,11 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request {
array($this->trust_root, $this->return_to));
}
function fromMessage(&$message, $server)
/*
* Keyboard Monkeys modification:
* Removed & marker in argument
*/
function fromMessage($message, $server)
{
$mode = $message->getArg(Auth_OpenID_OPENID_NS, 'mode');
$immediate = null;
@ -1097,7 +1101,11 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request {
in OpenID 1.x immediate mode.');
}
$setup_request =& new Auth_OpenID_CheckIDRequest(
/*
* Keyboard Monkeys modification:
* Assigning the return value of new by reference is deprecated
*/
$setup_request = new Auth_OpenID_CheckIDRequest(
$this->identity,
$this->return_to,
$this->trust_root,
@ -1676,12 +1684,16 @@ class Auth_OpenID_UntrustedReturnURL extends Auth_OpenID_ServerError {
class Auth_OpenID_Server {
function Auth_OpenID_Server(&$store, $op_endpoint=null)
{
$this->store =& $store;
$this->signatory =& new Auth_OpenID_Signatory($this->store);
$this->encoder =& new Auth_OpenID_SigningEncoder($this->signatory);
$this->decoder =& new Auth_OpenID_Decoder($this);
/*
* Keyboard Monkeys modification:
* Assigning the return value of new by reference is deprecated
*/
$this->store = $store;
$this->signatory = new Auth_OpenID_Signatory($this->store);
$this->encoder = new Auth_OpenID_SigningEncoder($this->signatory);
$this->decoder = new Auth_OpenID_Decoder($this);
$this->op_endpoint = $op_endpoint;
$this->negotiator =& Auth_OpenID_getDefaultNegotiator();
$this->negotiator = Auth_OpenID_getDefaultNegotiator();
}
/**
@ -1714,8 +1726,9 @@ class Auth_OpenID_Server {
/**
* The callback for 'associate' messages.
* Keyboard Monkeys modification: removed & in argument, because it was killing unit tests
*/
function openid_associate(&$request)
function openid_associate($request)
{
$assoc_type = $request->assoc_type;
$session_type = $request->session->session_type;

View File

@ -351,10 +351,14 @@ class Auth_Yadis_XRDS {
$services = $this->parser->evalXPath('xrd:Service', $this->xrdNode);
/*
* Keyboard Monkeys modification:
* Assigning the return value of new by reference is deprecated
*/
foreach ($services as $node) {
$s =& new Auth_Yadis_Service();
$s = new Auth_Yadis_Service();
$s->element = $node;
$s->parser =& $this->parser;
$s->parser = $this->parser;
$priority = $s->getPriority();
@ -475,4 +479,4 @@ class Auth_Yadis_XRDS {
}
}
?>
?>