From: Michiel de Jong Date: Mon, 7 May 2012 07:46:15 +0000 (+0200) Subject: require base lib and deal with malformed user addresses in webfinger.php X-Git-Tag: v4.0.0beta~1^2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4e47953aca6fe8fb0294d194b8a354437388486;p=nextcloud-server.git require base lib and deal with malformed user addresses in webfinger.php --- diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index e702f27b56e..7c59c53afec 100755 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -25,15 +25,17 @@ $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); $WEBROOT=substr($SUBURI,0,-34); */ +require_once('../../lib/base.php'); +$userName = ''; +$hostName = ''; $request = strip_tags(urldecode($_GET['q'])); if($_GET['q']) { $reqParts = explode('@', $request); - $userName = $reqParts[0]; - $hostName = $reqParts[1]; -} else { - $userName = ''; - $hostName = ''; + if(count($reqParts)==2) { + $userName = $reqParts[0]; + $hostName = $reqParts[1]; + } } if(substr($userName, 0, 5) == 'acct:') { $userName = substr($userName, 5);