git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
login/edit: prepare input restriction for user names
[minimedit.git]
/
login
/
edit.php
diff --git
a/login/edit.php
b/login/edit.php
index 017a56221a5c9765c99915b840d3a977a9c632ac..4002cb989098d65db18a1f6c225c283050c0aecd 100644
(file)
--- a/
login/edit.php
+++ b/
login/edit.php
@@
-45,7
+45,12
@@
foreach ($cols as $col => &$colconf) {
}
$cols = [
}
$cols = [
- 'login' => ['label' => 'login', 'value' => $user['name'], 'target' => NULL],
+ 'login' => [
+ 'label' => 'login',
+ 'value' => $user['name'],
+ 'target' => NULL,
+ 'pattern' => "[a-z0-9-]+",
+ ],
] + $cols;
if (isset($user['pass'])) {
] + $cols;
if (isset($user['pass'])) {
@@
-159,6
+164,7
@@
foreach ($cols as $col => &$colconf) {
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
+ 'pattern' => @$colconf['pattern'] ?: FALSE,
];
if (@$colconf['type'] == 'file') {
$attrs['accept'] = "image/jpeg";
];
if (@$colconf['type'] == 'file') {
$attrs['accept'] = "image/jpeg";