Fix check.php for new domain registration form

This commit is contained in:
Miraty 2023-04-11 02:43:16 +02:00
parent bd06fc7fbf
commit 088fe9ee53
1 changed files with 3 additions and 2 deletions

View File

@ -42,7 +42,6 @@ function curlTest($path, $args) {
CURLOPT_COOKIEJAR => COOKIE_FILE,
CURLOPT_POSTFIELDS => $args,
]);
var_dump(curl_error($req));
$status_code = curl_getinfo($req, CURLINFO_RESPONSE_CODE);
if ($status_code >= 400) {
var_dump(curl_exec($req));
@ -94,6 +93,7 @@ var_dump($subdomain);
curlTest('/reg/register', [
'subdomain' => $subdomain,
'suffix' => SUFFIX,
'action' => 'register',
]);
curlTest('/reg/ns', [
@ -130,7 +130,6 @@ if (proc_close($process) !== 0)
$html = curlTest('/ht/add-onion', [
'dir' => '_site0-'
]);
var_dump($html);
if (preg_match('#\<code\>http\://(?<onion>[0-9a-z]{56})\.onion/\</code\>#D', $html, $matches) !== 1)
exit('Can\'t find onion address.');
@ -156,3 +155,5 @@ curlTest('/auth/unregister', [
]);
unlink(COOKIE_FILE);
echo 'OK' . LF;