Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit username length to 16 characters #256

Merged
merged 1 commit into from Nov 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions git-php.php
Expand Up @@ -58,8 +58,8 @@
// Check for errors
if (empty($_POST['id'])) {
$error .= "You must supply a desired Git user id. <br>";
} elseif(!preg_match('!^[a-z]\w+$!', $_POST['id'])) {
$error .= "Your user id must be >1 char long, start with ".
} elseif(!preg_match('!^[a-z]\w+$!', $_POST['id']) || strlen($_POST['id']) > 16) {
$error .= "Your user id must be from 1-16 characters long, start with ".
"a letter and contain nothing but a-z, 0-9, and _ <br>";
}
if (empty($_POST['fullname'])) {
Expand Down Expand Up @@ -394,7 +394,7 @@ class="max" value="<?php if (isset($_POST['email'])) echo clean($_POST['email'])
<td><input type="checkbox" name="guidelines" value="1" id="vcs-guidelines"> <label for="vcs-guidelines">Check the box if you agree</label></td>
</tr>
<tr>
<th class="subr">User ID:<br> <small>(single word, lower case)</small></th>
<th class="subr">User ID:<br> <small>(single word, lower case, max 16 characters)</small></th>
<td><input type="text" size="10" name="id"
class="max" value="<?php if (isset($_POST['id'])) echo clean($_POST['id']);?>"></td>
</tr>
Expand Down