From c8ac4fdd905190f4d89420a1ee143e3fdd5215b2 Mon Sep 17 00:00:00 2001 From: Dominika Liberda Date: Thu, 29 Oct 2020 23:28:09 +0100 Subject: [PATCH] %40 -> @ --- webroot/api/register.shs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webroot/api/register.shs b/webroot/api/register.shs index 9806059..3934b93 100644 --- a/webroot/api/register.shs +++ b/webroot/api/register.shs @@ -2,18 +2,20 @@ source "${cfg[namespace]}/code/common.sh" if [[ "${post_data[login]}" != '' && "${post_data[password]}" != '' && "${post_data[mail]}" != '' ]]; then - if ! check_mail "${post_data[mail]}"; then + mail="$(echo "${post_data[mail]}" | sed -s 's/%40/@/')" + if ! check_mail "$mail"; then status=1 reason="This mail address is already in use!" else register "${post_data[login]}" "${post_data[password]}" status=$? verification="$RANDOM" - echo "${post_data[login]}:${post_data[mail]}:$verification:no" >> secret/mail.dat + + echo "${post_data[login]}:$mail:$verification:no" >> secret/mail.dat fi if [[ $status == 0 ]]; then - sender_name="${cfg[who]}" mailsend "${post_data[mail]}" "OCW mail verification" "Hi ${post_data[login]}, + sender_name="${cfg[who]}" mailsend "$mail" "OCW mail verification" "Hi ${post_data[login]}, Your code: $verification