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

Fix @-code replacment logic in newuser.msg

Fix 2 issues with commit df799b0a:
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 4c6cc083
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -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