Partial fix of #1525

This commit is contained in:
Alan Garcia 2013-10-17 12:26:13 +00:00
parent 14159e0570
commit 2eb73fcd47
4 changed files with 4 additions and 4 deletions

View File

@ -196,7 +196,7 @@ while (list($key,$val)=each($r)) {
</tr>
<?php
} // while (list($key,$val)=each($r)) {
echo '</table></form>';
echo '</table></form><br/>';
} // NORMAL MODE
if ($mem->user["admlist"]==1) { // SHORT MODE

View File

@ -510,7 +510,7 @@ class m_admin {
}
}
$login=strtolower($login);
if (!preg_match("#^[a-z0-9]*$#",$login)) { //$
if (!preg_match("#^[a-z0-9\-]+$#",$login)) { //$
$err->raise("admin", _("Login can only contains characters a-z and 0-9"));
return false;
}

View File

@ -42,7 +42,7 @@ while getopts "l:u:f:d:" optname
do
case "$optname" in
"l")
if [[ "$OPTARG" =~ ^[a-zA-Z0-9_]+$ ]] ; then
if [[ "$OPTARG" =~ ^[a-zA-Z0-9_\-]+$ ]] ; then
query="SELECT uid,login FROM membres WHERE login LIKE '$OPTARG'"
else
echo "Bad login provided"

View File

@ -68,7 +68,7 @@ echo $uid
# Return the html path for a account name
get_html_path_by_name() {
local name="$1"
if [[ ! "$name" =~ ^([a-z0-9]+)$ ]] ; then
if [[ ! "$name" =~ ^([a-z0-9\-]+)$ ]] ; then
# Error on error flux
echo "Account name is incorrect." >&2
exit 2