summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-03 07:43:17 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-03 07:43:17 -0400
commit31829840802dd8433fdb278c8b014c45c7ef39c8 (patch)
treeb59462bcba2840a284487aeb5a74f2e7816f97bb
parent38b5ad6fd63439f53fc137c4b23f3ecd249f8790 (diff)
fix service discovery (I think)
darcs-hash:20080603114317-84dde-04fe2734003fa8023708b6dbda6243d9fd15e9d8.gz
-rw-r--r--actions/remotesubscribe.php6
-rw-r--r--lib/omb.php4
2 files changed, 7 insertions, 3 deletions
diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php
index 16c991fe8..964aa45a2 100644
--- a/actions/remotesubscribe.php
+++ b/actions/remotesubscribe.php
@@ -131,7 +131,7 @@ class RemotesubscribeAction extends Action {
common_debug('remotesubscribe.php - looking for oauth discovery service');
- $oauth_services = $xrds->services(omb_service_filter(OAUTH_DISCOVERY));
+ $oauth_services = omb_get_services($xrds, OAUTH_DISCOVERY);
if (!$oauth_services) {
common_debug('remotesubscribe.php - failed to find oauth discovery service');
@@ -158,7 +158,7 @@ class RemotesubscribeAction extends Action {
common_debug('remotesubscribe.php - looking for OMB discovery service');
- $omb_services = $xrds->services(omb_service_filter(OMB_NAMESPACE));
+ $omb_services = omb_get_services($xrds, OMB_NAMESPACE);
if (!$omb_services) {
common_debug('remotesubscribe.php - failed to find OMB discovery service');
@@ -224,7 +224,7 @@ class RemotesubscribeAction extends Action {
function addServices($xrd, $types, &$omb) {
foreach ($types as $type) {
- $matches = $xrd->services(omb_service_filter($type));
+ $matches = omb_get_services($xrd, $type);
common_debug('remotesubscribe.php - ' . count($matches) . ' matches for "'.$type.'"');
if ($matches) {
foreach ($matches as $match) {
diff --git a/lib/omb.php b/lib/omb.php
index 9d4a327a9..c75fb7903 100644
--- a/lib/omb.php
+++ b/lib/omb.php
@@ -66,6 +66,10 @@ function omb_hmac_sha1() {
return $hmac_method;
}
+function omb_get_services($xrd, $type) {
+ return $xrd->services(array(omb_service_filter($type)));
+}
+
function omb_service_filter($type) {
return create_function('$s',
'return omb_match_service($s, \''.$type.'\');');