aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-08-13 09:46:01 +0200
committerMario Vavti <mario@mariovavti.com>2019-08-13 09:46:01 +0200
commite8f3b7f8530c69045dcabffecab2f158d0b35214 (patch)
treee02872bbb9a7226f30f78a1784fae113431eceaa /include/network.php
parent892e9cd835612c8155bf3c15436137f94abbb667 (diff)
parente28341ca4beb1b746a5c17590f62c02cc8df49ba (diff)
downloadvolse-hubzilla-e8f3b7f8530c69045dcabffecab2f158d0b35214.tar.gz
volse-hubzilla-e8f3b7f8530c69045dcabffecab2f158d0b35214.tar.bz2
volse-hubzilla-e8f3b7f8530c69045dcabffecab2f158d0b35214.zip
Merge branch '4.4RC'4.4
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/network.php b/include/network.php
index c754625cd..f6992291d 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1183,12 +1183,12 @@ function discover_by_webbie($webbie, $protocol = '') {
*/
function webfinger_rfc7033($webbie, $zot = false) {
- if(strpos($webbie,'@')) {
+ if(filter_var($webbie, FILTER_VALIDATE_EMAIL)) {
$lhs = substr($webbie,0,strpos($webbie,'@'));
$rhs = substr($webbie,strpos($webbie,'@')+1);
$resource = urlencode('acct:' . $webbie);
}
- else {
+ elseif(filter_var($webbie, FILTER_VALIDATE_URL)) {
$m = parse_url($webbie);
if($m) {
if($m['scheme'] !== 'https')
@@ -1197,9 +1197,10 @@ function webfinger_rfc7033($webbie, $zot = false) {
$rhs = $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
$resource = urlencode($webbie);
}
- else
- return false;
}
+ else
+ return false;
+
logger('fetching url from resource: ' . $rhs . ':' . $webbie);
$counter = 0;
@@ -1217,7 +1218,7 @@ function webfinger_rfc7033($webbie, $zot = false) {
function old_webfinger($webbie) {
$host = '';
- if(strstr($webbie,'@'))
+ if(filter_var($webbie, FILTER_VALIDATE_EMAIL))
$host = substr($webbie,strpos($webbie,'@') + 1);
if(strlen($host)) {