Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve file validation #65

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

Kevin-CB
Copy link
Contributor

The filepath validation performed on the doCheckLinkIcon needed some improvement, it was still allowing to discover if a directory called userContent[RandomString] existed. Which I agree, is an edge case that will never happen in the real world.

To fix that, I simply added a file separator to the userContent definition to avoid this behavior.

Testing done

Create a directory called userContent2 at the same level as the userContent one and called:

[JENKINS_INSTANCE]/descriptorByName/hudson.plugins.sidebar_link.SidebarLinkPlugin/checkLinkIcon?value=userContent2/[AnotherFile]

I also tested that it was still working for a correct usage, e.g:

[JENKINS_INSTANCE]/descriptorByName/hudson.plugins.sidebar_link.SidebarLinkPlugin/checkLinkIcon?value=userContent/readme.txt

@damianszczepanik damianszczepanik merged commit 3f9dd9b into jenkinsci:master Sep 3, 2023
17 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.

None yet

2 participants