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

No description provided.

@Keeper-of-the-Keys
Copy link
Author

Description is in #711

@skjnldsv
Copy link
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
Author

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

@Keeper-of-the-Keys
Copy link
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
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
Member

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

@Keeper-of-the-Keys
Copy link
Author

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

@skjnldsv
Copy link
Member

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

@Keeper-of-the-Keys
Copy link
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.

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