Skip to content

Commit 350de62

Browse files
author
tailor
committed
[project @ Update NEWS, add specific error to complete() with query as first parameter]
1 parent 691ad46 commit 350de62

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Auth/OpenID/Consumer.php

+8
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,14 @@ function &beginWithoutDiscovery($endpoint, $anonymous=false)
401401
*/
402402
function complete($return_to, $query=null)
403403
{
404+
if ($return_to && !is_string($return_to)) {
405+
// This is ugly, but we need to complain loudly when
406+
// someone uses the API incorrectly.
407+
trigger_error("return_to must be a string; see NEWS file " .
408+
"for upgrading notes.",
409+
E_USER_ERROR);
410+
}
411+
404412
if ($query === null) {
405413
$query = Auth_OpenID::getQuery();
406414
}

NEWS

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ If you cannot run the Python script, you can re-create your store by
4444
dropping the tables in the store and calling createTables() on the
4545
store object.
4646

47-
Consumers should now pass an additional parameter to
47+
Consumers should now pass the consumer return_to URL to
4848
Auth_OpenID_Consumer::complete() to defend against return_to URL
49-
tampering.
49+
tampering. This has REPLACED the old parameter, $query. $query is
50+
now a second optional parameter. It is STRONGLY RECOMMENDED that you
51+
never override $query, since the OpenID library uses its own logic to
52+
sidestep PHP's broken request-processing code.
5053

5154

5255
Summary of API Changes

0 commit comments

Comments
 (0)