Escape underscores in user list

This commit is contained in:
hedy 2023-06-13 18:16:53 +08:00
parent 4c5966d48d
commit bc28109cf1
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,8 @@ do
if [ "$(stat -c %G "/home/$user")" == "deleted" ];then
echo "<del>~$user</del> ";
else if [ "$(stat -c %G "/home/$user")" != "banned" ];then
echo "[~$user](/~$user) ";
# Escape underscores (note that username is '[a-z][-0-9a-z_]{2,}')
echo "[~${user//_/\\_}](/~$user) ";
else
echo "~$user ([banned](banned.html#$user)) ";
fi;fi