Commit 0bcf41a3 authored by David_Rothstein's avatar David_Rothstein

Issue #1379056 by Barrett: Fixed if more than one hook_openid() implementation...

Issue #1379056 by Barrett: Fixed if more than one hook_openid() implementation returns a given parameter, the resulting value is an array and request is invalid.
parent 6cb8c8a0
Drupal 7.22, xxxx-xx-xx (development version)
- Fixed OpenID errors when more than one module implements hook_openid(). The
behavior is now changed so that if more than one module tries to set the same
parameter, the last module's change takes effect.
- Fixed a serious documentation bug: The $name variable in the
taxonomy-term.tpl.php theme template was incorrectly documented as being
sanitized when in fact it is not.
......@@ -787,7 +787,21 @@ function openid_authentication_request($claimed_id, $identity, $return_to = '',
$request = array_merge($request, module_invoke_all('openid', 'request', $request));
return $request;
// module_invoke_all() uses array_merge_recursive() which might return nested
// arrays if two or more modules alter a given parameter, resulting in an
// invalid request format. To ensure this doesn't happen, we flatten the returned
// value by taking the last entry in the array if an array is returned.
$flattened_request = array();
foreach ($request as $key => $value) {
if (is_array($value)) {
$flattened_request[$key] = end($value);
else {
$flattened_request[$key] = $value;
return $flattened_request;
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