fix(security): align QQBot log sanitizer with CodeQL · openclaw/openclaw@f31311d
vincentkoc
·
2026-04-30
·
via Recent Commits to openclaw:main
File tree
extensions/qqbot/src/engine/utils
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,20 +42,20 @@ function formatDebugLogArgs(args: unknown[]): string {
|
42 | 42 | /** Debug-level log; only outputs when QQBOT_DEBUG is enabled. */ |
43 | 43 | export function debugLog(...args: unknown[]): void { |
44 | 44 | if (isDebug()) { |
45 | | -console.log(formatDebugLogArgs(args).replace(/[\r\n]/g, " ")); |
| 45 | +console.log(formatDebugLogArgs(args).replace(/\n|\r/g, "")); |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** Debug-level warning; only outputs when QQBOT_DEBUG is enabled. */ |
50 | 50 | export function debugWarn(...args: unknown[]): void { |
51 | 51 | if (isDebug()) { |
52 | | -console.warn(formatDebugLogArgs(args).replace(/[\r\n]/g, " ")); |
| 52 | +console.warn(formatDebugLogArgs(args).replace(/\n|\r/g, "")); |
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** Debug-level error; only outputs when QQBOT_DEBUG is enabled. */ |
57 | 57 | export function debugError(...args: unknown[]): void { |
58 | 58 | if (isDebug()) { |
59 | | -console.error(formatDebugLogArgs(args).replace(/[\r\n]/g, " ")); |
| 59 | +console.error(formatDebugLogArgs(args).replace(/\n|\r/g, "")); |
60 | 60 | } |
61 | 61 | } |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。