diff options
author | Florian Hülsmann <fh@cbix.de> | 2012-05-07 13:15:24 +0400 |
---|---|---|
committer | Florian Hülsmann <fh@cbix.de> | 2012-05-07 13:15:24 +0400 |
commit | 1a77da97bb338d5e61131a0408360012bdda7a0c (patch) | |
tree | e3513a78716f70d0a6f9df95a8303c13f3f75480 /user_webfinger | |
parent | ff4ea6756b829997c75d554abdd15e828f375d52 (diff) |
better invalid webfinger URI handling
Diffstat (limited to 'user_webfinger')
-rwxr-xr-x | user_webfinger/webfinger.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/user_webfinger/webfinger.php b/user_webfinger/webfinger.php index bb7bb68f7..307a16300 100755 --- a/user_webfinger/webfinger.php +++ b/user_webfinger/webfinger.php @@ -51,12 +51,16 @@ if(isset($_SERVER['HTTPS'])) { $baseAddress = 'http://'; } $baseAddress .= $_SERVER['SERVER_NAME'].OC::$WEBROOT; +if(empty($id)) { + header("HTTP/1.0 400 Bad Request"); +} define('WF_USER', $userName); define('WF_ID', $id); define('WF_BASEURL', $baseAddress); echo "<"; ?> ?xml version="1.0" encoding="UTF-8"?> +<?php if(empty($id)) echo '<!-- Invalid URI: ' . str_replace('>', '/>', $request) . " -->\n"; ?> <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0"> <hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME']; ?></hm:Host> <Subject>acct:<?php echo $id ?></Subject> |