aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-08 18:44:30 -0800
committerFriendika <info@friendika.com>2011-02-08 18:44:30 -0800
commitf70a0b028288fa13c64f1ffaa310765a95347dac (patch)
tree89507dc18fd29a50c999c2b60cc89b6ef2406078 /boot.php
parent766c4778cb0a678ef7f55e56cbd11497a73ae6cb (diff)
downloadvolse-hubzilla-f70a0b028288fa13c64f1ffaa310765a95347dac.tar.gz
volse-hubzilla-f70a0b028288fa13c64f1ffaa310765a95347dac.tar.bz2
volse-hubzilla-f70a0b028288fa13c64f1ffaa310765a95347dac.zip
more graceful handling of some statusnet followups
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index 7fbd2a6fb..8492b8be0 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1037 );
+define ( 'BUILD_ID', 1038 );
define ( 'FRIENDIKA_VERSION', '2.10.0905' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
@@ -1378,10 +1378,12 @@ function webfinger($s) {
logger('webfinger: lrdd template: ' . $tpl);
if(strlen($tpl)) {
$pxrd = str_replace('{uri}', urlencode('acct:'.$s), $tpl);
+ logger('webfinger: pxrd: ' . $pxrd);
$links = fetch_xrd_links($pxrd);
if(! count($links)) {
// try with double slashes
$pxrd = str_replace('{uri}', urlencode('acct://'.$s), $tpl);
+ logger('webfinger: pxrd: ' . $pxrd);
$links = fetch_xrd_links($pxrd);
}
return $links;
@@ -1453,6 +1455,7 @@ function fetch_lrdd_template($host) {
$tpl = '';
$url = 'http://' . $host . '/.well-known/host-meta' ;
$links = fetch_xrd_links($url);
+logger('template: ' . print_r($links,true));
if(count($links)) {
foreach($links as $link)
if($link['@attributes']['rel'] && $link['@attributes']['rel'] === 'lrdd')
@@ -1479,15 +1482,30 @@ function fetch_xrd_links($url) {
$h = simplexml_load_string($xml);
$arr = convert_xml_element_to_array($h);
+ $links = array();
+
if(isset($arr['xrd']['link'])) {
$link = $arr['xrd']['link'];
if(! isset($link[0]))
$links = array($link);
else
$links = $link;
- return $links;
}
- return array();
+ if(isset($arr['xrd']['alias'])) {
+ $alias = $arr['xrd']['alias'];
+ if(! isset($alias[0]))
+ $aliases = array($alias);
+ else
+ $aliases = $alias;
+ foreach($aliases as $alias) {
+ $links[]['@attributes'] = array('rel' => 'alias' , 'href' => $alias);
+ }
+ }
+
+ logger('fetch_xrd_links: ' . print_r($links,true), LOGGER_DATA);
+
+ return $links;
+
}}
// Convert an ACL array to a storable string