Skip to content

Conversation

@noppa
Copy link
Owner

@noppa noppa commented Jun 19, 2025

Adds new optional option modifyArguments, which allows you to arbitrarily add or modify the command line arguments that are passed to the xmllint command. The option is a function that receives the current arguments as an array, and should return a new array of string arguments.
Closes #22.

Also adds validation that XML and Schema file names do not start with a dash (-), or contain a space and a dash ( -), which would cause xmllint to interpret the file name as a command line option. File names could be user-inputted, so this change is to prevent end users from accidentally or maliciously changing the expected behaviour of the validation. It is recommended, though, to also do stricter validation of file names if you accept them from user input. This is a breaking change if you previously passed in file names that started with a dash. There is a new option disableFileNameValidation to disable this validation if you want to keep the old behaviour and accept any kind of file name.

noppa added 2 commits June 20, 2025 02:28
Adds new optional option `modifyArguments`, which allows you to
arbitrarily add or modify the command line arguments that are passed to
the xmllint command. The option is a function that receives the current
arguments as an array, and should return a new array of string
arguments.
Closes [#22](#22).

Also adds validation that XML and Schema file names do not start with a
dash (`-`), or contain a space and a dash (` -`), which would cause
xmllint to interpret the file name as a command line option. File names
could be user-inputted, so this change is to prevent end users from
accidentally or maliciously changing the expected behaviour of the
validation. It is recommended, though, to also do stricter validation of
file names if you accept them from user input. This is a **breaking
change** if you previously passed in file names that started with a
dash. There is a new option `disableFileNameValidation` to disable this
validation if you want to keep the old behaviour and accept any kind of
file name.
@noppa noppa merged commit 34fe656 into master Jun 19, 2025
6 checks passed
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.

Feature Request: Allow additional xmllint parameters

1 participant