-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
switch to Files Node API for zip generation #17822
Conversation
/backport to stable17 |
lib/private/legacy/files.php
Outdated
$fileTime = \OC\Files\Filesystem::filemtime($file); | ||
$fh = \OC\Files\Filesystem::fopen($file, 'r'); | ||
$streamer->addFileFromStream($fh, basename($file), $fileSize, $fileTime); | ||
$owner = \OC\Files\Filesystem::getOwner($file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't use the owner but the current user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icewind1991 what about unauthenticated users, on public shares?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have the "current user" set correctly afaik, since it's also needed for the old Filesystem
stuff to work (worth double testing though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, using $userFolder = \OC::$server->getUserFolder();
returns null
in that case. Of cours we can try that first and fall back to the owner? Or does it open any loophole? Previously it also only just read it. IIRC it's best to avoid using root folder directly for performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\OC::$server->getRootFolder()->get(Filesystem::getRoot())
would always have the same behavior as using the old api
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4852da5
to
f9bfd48
Compare
/backport to stable16 |
backport to stable17 in #17840 |
backport to stable16 in #17841 |
since it is disencouraged to use the static Filesystem methods