require base lib and deal with malformed user addresses in webfinger.php

This commit is contained in:
Michiel de Jong 2012-05-07 09:46:15 +02:00
parent 5155f589fd
commit c4e47953ac
1 changed files with 7 additions and 5 deletions

View File

@ -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);