mirror of
https://github.com/Nathanwoodburn/hnschat-web.git
synced 2025-12-06 00:33:01 +11:00
v2
This commit is contained in:
2
wallets/.htaccess
Normal file
2
wallets/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
RewriteEngine on
|
||||
RewriteRule ^.well-known/wallets/(.+)$ index.php?wallet=$1
|
||||
26
wallets/index.php
Normal file
26
wallets/index.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
include "../etc/includes.php";
|
||||
|
||||
$domain = $_SERVER["SERVER_NAME"];
|
||||
$request = $_SERVER["REQUEST_URI"];
|
||||
$wallet = @$_GET["wallet"];
|
||||
|
||||
if ($wallet) {
|
||||
if (strtolower($request) == strtolower("/.well-known/wallets/HNS")) {
|
||||
$info = @sql("SELECT * FROM `domains` WHERE `domain` = ?", [$domain])[0];
|
||||
|
||||
if ($info && @$info["address"]) {
|
||||
echo $info["address"];
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
http_response_code(404);
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
<html><head>
|
||||
<title>404 Not Found</title>
|
||||
</head><body>
|
||||
<h1>Not Found</h1>
|
||||
<p>The requested URL was not found on this server.</p>
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user