aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-08-11 10:39:03 +0200
committerManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-08-11 10:39:03 +0200
commitb89d2d7580e40cd417defaffd2514b5eed38577d (patch)
tree78ba9004d87b994dd9a531b475fd51b940bf3dd8 /include/network.php
parent350e636e3d0a44323c69185555e89cc01a213aa2 (diff)
parent047dd31724f8da12c153b4a6f27dc5462f7b97e5 (diff)
downloadvolse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.tar.gz
volse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.tar.bz2
volse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.zip
Merge remote-tracking branch 'upstream/dev' into dev
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)) {