aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-09-08 20:15:27 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-09-08 20:15:27 +0200
commitd284f8017cefb79571fe51c4ae3f85b9b4e517c9 (patch)
treefbf1902147b237649048e2ab6ac8a84ffe0bf838 /include/network.php
parent2fabf8d2188516a36589487bfa2ca01dea0c5ca2 (diff)
parent68c23f6c86e2f2e24548b179f00b5bcd5ab8ba87 (diff)
downloadvolse-hubzilla-d284f8017cefb79571fe51c4ae3f85b9b4e517c9.tar.gz
volse-hubzilla-d284f8017cefb79571fe51c4ae3f85b9b4e517c9.tar.bz2
volse-hubzilla-d284f8017cefb79571fe51c4ae3f85b9b4e517c9.zip
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/network.php b/include/network.php
index 2832ae2d3..deb257ff3 100644
--- a/include/network.php
+++ b/include/network.php
@@ -259,22 +259,29 @@ function convert_xml_element_to_array($xml_element, &$recursion_depth=0) {
// or if the resultant personal XRD doesn't contain a supported
// subscription/friend-request attribute.
+// amended 7/9/2011 to return an hcard which could save potentially loading
+// a lengthy content page to scrape dfrn attributes
+
if(! function_exists('webfinger_dfrn')) {
-function webfinger_dfrn($s) {
+function webfinger_dfrn($s,&$hcard) {
if(! strstr($s,'@')) {
return $s;
}
+ $profile_link = '';
+
$links = webfinger($s);
logger('webfinger_dfrn: ' . $s . ':' . print_r($links,true), LOGGER_DATA);
if(count($links)) {
- foreach($links as $link)
+ foreach($links as $link) {
if($link['@attributes']['rel'] === NAMESPACE_DFRN)
- return $link['@attributes']['href'];
- foreach($links as $link)
+ $profile_link = $link['@attributes']['href'];
if($link['@attributes']['rel'] === NAMESPACE_OSTATUSSUB)
- return 'stat:' . $link['@attributes']['template'];
+ $profile_link = 'stat:' . $link['@attributes']['template'];
+ if($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard')
+ $hcard = $link['@attributes']['href'];
+ }
}
- return '';
+ return $profile_link;
}}
// Given an email style address, perform webfinger lookup and