Skip to content
Snippets Groups Projects
Commit 8534373f authored by Florian Hülsmann's avatar Florian Hülsmann
Browse files

better invalid webfinger URI handling

parent 3a184e2e
Branches
No related tags found
No related merge requests found
<?php if(OC_User::userExists(WF_USER)) { ?>
<Link <Link
rel="remoteStorage" rel="remoteStorage"
template="<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/" template="<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/"
api="WebDAV" api="WebDAV"
auth="<?php echo WF_BASEURL; ?>/apps/remoteStorage/auth.php/<?php echo WF_USER; ?>"> auth="<?php echo WF_BASEURL; ?>/apps/remoteStorage/auth.php/<?php echo WF_USER; ?>">
</Link> </Link>
<?php } ?>
...@@ -51,12 +51,16 @@ if(isset($_SERVER['HTTPS'])) { ...@@ -51,12 +51,16 @@ if(isset($_SERVER['HTTPS'])) {
$baseAddress = 'http://'; $baseAddress = 'http://';
} }
$baseAddress .= $_SERVER['SERVER_NAME'].OC::$WEBROOT; $baseAddress .= $_SERVER['SERVER_NAME'].OC::$WEBROOT;
if(empty($id)) {
header("HTTP/1.0 400 Bad Request");
}
define('WF_USER', $userName); define('WF_USER', $userName);
define('WF_ID', $id); define('WF_ID', $id);
define('WF_BASEURL', $baseAddress); define('WF_BASEURL', $baseAddress);
echo "<"; echo "<";
?> ?>
?xml version="1.0" encoding="UTF-8"?> ?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"> <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> <hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME']; ?></hm:Host>
<Subject>acct:<?php echo $id ?></Subject> <Subject>acct:<?php echo $id ?></Subject>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment