Skip to content

fix: allow embedded newlines in arguments#40

Merged
sjinks merged 1 commit intotrunkfrom
fix/multiline
Jun 3, 2025
Merged

fix: allow embedded newlines in arguments#40
sjinks merged 1 commit intotrunkfrom
fix/multiline

Conversation

@sjinks
Copy link
Copy Markdown
Member

@sjinks sjinks commented Jan 13, 2025

This PR updates validateCommand() to allow for whitespace characters in the arguments.

validateCommand() used to merge consecutive whitespace characters and replace them with the space character. This broke things when we needed to pass multiple whitespace characters (e.g., preformatted text) or embed a newline character.

Test:

go build && ./cron-control-runner -token xxx
$ echo -e "xxx;$(uuidgen);53;206;option  set \n xxx \"a\nb\"" | nc 127.0.0.1 22122
Success: Updated 'xxx' option.

$ wp option get xxx
a
b

⚠️ the base branch for this PR is BB8-12231 (#32) because it relies upon the new logic in tokenizeString introduced in that PR.

@sjinks sjinks self-assigned this Jan 13, 2025
Base automatically changed from BB8-12231 to trunk January 21, 2025 17:51
@sjinks sjinks merged commit e436aa5 into trunk Jun 3, 2025
1 check passed
@sjinks sjinks deleted the fix/multiline branch June 3, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants