Commit 3539394bc9ba43ddcc98b4e105b6bdf2e56d850b
1 parent
afeff1ad3c
Exists in
master
perbaikan sn
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
xmlout.js
... | ... | @@ -176,7 +176,11 @@ function prefixMessageWithSN(data) { |
176 | 176 | |
177 | 177 | sn = ''; |
178 | 178 | |
179 | - if (data['MESSAGE'].search(/^SN=.+;/) == -1) { | |
179 | + if (data.SN && data.SN.trim()) { | |
180 | + sn = data['SN'].replace(/ /g, '-').replace(/-*/g, '-').trim(); | |
181 | + return 'SN=' + sn + '; ' + data['MESSAGE']; | |
182 | + } | |
183 | + else if (data['MESSAGE'].search(/^SN=.+;/) == -1) { | |
180 | 184 | if (data['SN'] && data['SN'].trim()) { |
181 | 185 | sn = data['SN'].trim(); |
182 | 186 | } |