mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 02:21:36 +00:00
* fix(terminal-core): prevent $ pattern injection in replaceHomePath The second argument of String.prototype.replace() interprets $ sequences as special replacement patterns ($&, $`, $', $1-$9, $<name>). When the user home directory path contains $ followed by special characters, the replacement produces a corrupted path in the display string. Using a replacer function (() => fallbackHome) instead of the raw string argument prevents $ pattern interpretation, ensuring the literal home directory path is used regardless of its content. * test(terminal-core): cover literal dollar home paths --------- Co-authored-by: lizeyu-xydt <li.zeyu@xydigit.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>