Skip to content
Snippets Groups Projects
Commit e31e8979 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix @-code replacment logic in newuser.msg

Fix 2 issues with commit 680e30d8:
1. Need to replace @-code globally, otherwise only the first @-code was replaced
2. Need to strip the leading and trailing @'s from the code before passing to bbs.atcode() - fix for issue #527
parent 0135c4c4
No related branches found
No related tags found
No related merge requests found
......@@ -142,7 +142,7 @@ function send_newuser_welcome_msg(fname)
subject: "Welcome to " + system.name + "!"
};
msgtxt = msgtxt.replace(/@(\w+)@/, function (code) { return bbs.atcode(code); });
msgtxt = msgtxt.replace(/@(\w+)@/g, function (code) { return bbs.atcode(code.slice(1, -1)); });
var result = msgbase.save_msg(hdr, msgtxt);
if(!result)
log(LOG_ERR, "!ERROR " + msgbase.error + " saving mail message");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment