Commit 15c426f7fa04c83d28a81b6be830ac62e644e693
1 parent
1d660052dd
Exists in
master
Log: escape space and new line
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
lib/apiserver/routers/smstools.js
... | ... | @@ -30,7 +30,7 @@ async function pageRestart(req, res) { |
30 | 30 | |
31 | 31 | function pageLog(req, res) { |
32 | 32 | const maxLines = (Number(req.query.max) || 200); |
33 | - const keyword = req.query.keyword && escapeQuotes(req.query.keyword, '\'"&|*<>[];$'); | |
33 | + const keyword = req.query.keyword && escapeQuotes(req.query.keyword, '\'\n"&|*<>[];$ '); | |
34 | 34 | const cmd = req.query.keyword ? `tail -n ${maxLines * 50} /var/log/smsd/smsd.log | grep --ignore-case ${keyword} | tail -n ${maxLines} | tac` |
35 | 35 | : `tail -n ${maxLines} /var/log/smsd/smsd.log | tac`; |
36 | 36 |