From c4e47953aca6fe8fb0294d194b8a354437388486 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Mon, 7 May 2012 09:46:15 +0200 Subject: [PATCH] require base lib and deal with malformed user addresses in webfinger.php --- apps/user_webfinger/webfinger.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); -- 2.39.5