forked from team/site
1
0
Fork 0

escape form fields

This commit is contained in:
Ben Harris 2021-09-12 17:25:33 -04:00
parent 35bff137f5
commit f87750af30
1 changed files with 19 additions and 15 deletions

View File

@ -1,6 +1,10 @@
<?php <?php
$filepath = __FILE__; $filepath = __FILE__;
include __DIR__.'/../header.php'; include __DIR__.'/../header.php';
function esc($v) {
return isset($_REQUEST[$v]) ? htmlspecialchars($_REQUEST[$v]) : "";
}
?> ?>
<div class="container" id="app"> <div class="container" id="app">
@ -19,24 +23,24 @@ include __DIR__.'/../header.php';
<form method="post"> <form method="post">
<?php include 'signup-handler.php'; ?> <?php include 'signup-handler.php'; ?>
<div class="form-group"> <div>
<label>your desired username (numbers and lowercase letters only, no spaces)</label> <p>your desired username (numbers and lowercase letters only, no spaces)</p>
<input class="form-control" name="username" value="<?=$_REQUEST["username"] ?? ""?>" type="text" required> <input class="form-control" name="username" value="<?=esc("username")?>" type="text" required>
</div> </div>
<div class="form-group"> <div>
<label>email to contact you with account info</label> <p>email to contact you with account info</p>
<input class="form-control" name="email" value="<?=$_REQUEST["email"] ?? ""?>" type="text" required> <input class="form-control" name="email" value="<?=esc("email")?>" type="text" required>
</div> </div>
<div class="form-group"> <div>
<label>what interests you about tilde.team?</label> <p>what interests you about tilde.team? we want to make sure you're a real human being :)</p>
<textarea class="form-control" name="interest" id="" cols="30" rows="10"><?=$_REQUEST["interest"] ?? ""?></textarea> <textarea required class="form-control" name="interest" id="" cols="40" rows="7"><?=esc("interest")?></textarea>
</div> </div>
<div class="form-group"> <div>
<label>SSH public key</label> <p>SSH public key</p>
<textarea required class="form-control" name="sshkey" id="" cols="30" rows="10"><?=$_REQUEST["sshkey"] ?? ""?></textarea> <textarea required class="form-control" name="sshkey" id="" cols="30" rows="10"><?=esc("sshkey")?></textarea>
<p>if you don't have a key, don't worry! <a href="/wiki/ssh">check out our guide to ssh keys</a> and make sure that you only put your pubkey here</p> <p>if you don't have a key, don't worry! <a href="/wiki/ssh">check out our guide to ssh keys</a> and make sure that you only put your pubkey here</p>
</div> </div>