Avoid crash when processing logs of files not under the source dir #563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for opening a pull request and contributing to asciidoctor-maven-plugin!
What kind of change does this PR introduce? (check at least one)
What is the goal of this pull request?
Validates if the cursor file path is contained in the configured source directory of the plugin to avoid crashing.
It also checks if the cursor is a remote url to prevent similar crash.
Are there any alternative ways to implement this?
The subpath and http validations could be done with java.io.Path but required methods are not available in Java8. This can be refactored with we drop compat for Java8 in v3.0.0.
Are there any implications of this pull request? Anything a user must know?
No.
Is it related to an existing issue?
StringIndexOutOfBoundsException
with version 2.2.1 #554Finally, please add a corresponding entry to CHANGELOG.adoc
Closes #554