Skip to content

fix: add trailing slash to nextcloudDir to fix #711#720

Open
Keeper-of-the-Keys wants to merge 2 commits intonextcloud:masterfrom
Keeper-of-the-Keys:fix-copy-with-path-clash
Open

fix: add trailing slash to nextcloudDir to fix #711#720
Keeper-of-the-Keys wants to merge 2 commits intonextcloud:masterfrom
Keeper-of-the-Keys:fix-copy-with-path-clash

Conversation

@Keeper-of-the-Keys
Copy link
Copy Markdown

No description provided.

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

Description is in #711

@skjnldsv
Copy link
Copy Markdown
Member

Hey, thanks for your pr!
I think it would be best to add a proper path helper method and use it when needed.
Could you also add some tests with it?

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

@skjnldsv Sure, I don't see phpunit tests under tests does it go elsewhere?

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

Also index.php does not seem amenable to being included and thus having unit tests run on it.

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

I can imagine some tests with the constructor of class Updater but that would require refactoring the code to have the class defined outside of index.php which seems to be out of scope of this PR....

Tests that I can think of

  1. new \Updater('') -- needs to through an Exception
  2. new \Updater(false) -- needs to through an Exception
  3. $update = new \Updater('/') -- $updater->nextcloudDir === '/'
  4. $update = new \Updater('/somedir') -- $updater->nextcloudDir === '/somedir/'
  5. $update = new \Updater('/somedir/') -- $updater->nextcloudDir == '/somedir/'

As said case (3) maybe should also warn/fail as it seems very unwise to me to install nextcloud at / but maybe some chroot jails would present it that way?

@skjnldsv please lmk how to proceed.

Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys <es-github@rosenberg.org.il>
@skjnldsv
Copy link
Copy Markdown
Member

@Keeper-of-the-Keys have a look at #722

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

@skjnldsv cool so should I add tests to that PR?
Wait until it is merged, rebase and write tests?

@skjnldsv
Copy link
Copy Markdown
Member

No, it should supersede this PR :)
Feel free to have a look and review it

@Keeper-of-the-Keys
Copy link
Copy Markdown
Author

Ah OK, I'll have a look but I'm only commenting as to issues that pertain to this PR, I don't know the rest of the codebase well enough to give valid feedback and am no phpunit expert.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants