Commit 0c44c896 authored by webchick's avatar webchick

Issue #1824712 by cam8001, alexpott: Convert xri_proxy_resolver() variable to CMI config system.

parent a2c97c9b
xri_proxy_resolver:
http://xri.net/
......@@ -88,7 +88,9 @@ function testDiscovery() {
$this->addIdentity(url('openid-test/yadis/http-equiv', array('absolute' => TRUE)), 2);
// Identifier is an XRI. Resolve using our own dummy proxy resolver.
variable_set('xri_proxy_resolver', url('openid-test/yadis/xrds/xri', array('absolute' => TRUE)) . '/');
config('openid.settings')
->set('xri_proxy_resolver', url('openid-test/yadis/xrds/xri', array('absolute' => TRUE)) . '/')
->save();
$this->addIdentity('@example*résumé;%25', 2, 'http://example.com/xrds', 'http://example.com/user');
// Make sure that unverified CanonicalID are not trusted.
......
......@@ -122,3 +122,14 @@ function openid_requirements($phase) {
function openid_update_last_removed() {
return 6000;
}
/**
* Moves xri_proxy_resolver settings from variable to config.
*
* @ingroup config_upgrade
*/
function openid_update_8001() {
update_variables_to_config('openid.settings', array(
'xri_proxy_resolver' => 'xri_proxy_resolver',
));
}
......@@ -526,7 +526,7 @@ function _openid_xri_discovery($claimed_id) {
if (_openid_is_xri($claimed_id)) {
// Resolve XRI using a proxy resolver (Extensible Resource Identifier (XRI)
// Resolution Version 2.0, section 11.2 and 14.3).
$xrds_url = variable_get('xri_proxy_resolver', 'http://xri.net/') . rawurlencode($claimed_id) . '?_xrd_r=application/xrds+xml';
$xrds_url = config('openid.settings')->get('xri_proxy_resolver') . rawurlencode($claimed_id) . '?_xrd_r=application/xrds+xml';
$discovery = _openid_xrds_discovery($xrds_url);
if (!empty($discovery['services']) && is_array($discovery['services'])) {
foreach ($discovery['services'] as $i => &$service) {
......
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