Commit Graph

34 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
Ferdinand Thiessen ba00416040 refactor(Streamer): inject `IDateTimeZone` as constructor arg
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-14 17:19:28 +07:00
Ferdinand Thiessen bb72eed4a2 fix(Streamer): use localtime for ZIP files
ZIP does not use a proper timestamp but uses something called "DOS time".
This is a weird old format with some limitations like accuracy of only
2 seconds, but also no timezone information.
Also unline UNIX time it is not relative to some specific point in time
with timezone information, but is always considered to be the local
time. Meaning we need to convert it first to the users local time.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-14 17:19:28 +07:00
Ferdinand Thiessen 32703d0500
fix(ZipFolderPlugin): set mtime of directories in archive
Directories should also have the correct mtime set and not the current
time. For this the `Streamer` class needs to support passing a time
attribute for creating folders, the underlying library already supports
this.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-13 10:23:47 +07:00
Josh be2f0765e4
fix(streamer): zip64 should work on 32-bit env now
Since DeepDiver1975/PHPZipStreamer#11 was merged

Signed-off-by: Josh <josh.t.richards@gmail.com>
2024-10-31 11:37:03 +07:00
Ferdinand Thiessen 2f66bd5b75
fix: Allow `Streamer` to specify type in constructor instead of magin UA handling
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-28 13:18:29 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Andrew Summers 40edb426a3 Refactor `OC\Server::getRootFolder`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2023-11-10 16:51:05 +07:00
Anna Larch 70a6eeed3e fix: log fopen calls when stream isn't available
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-07-20 17:28:25 +07:00
Côme Chilliet cd885b5705
Type sizes as int|float throughout the code base
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:31 +07:00
Côme Chilliet e156f8339c
Revert "remove 32-bit workarounds"
This reverts commit dd8774389e.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:28 +07:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +07:00
szaimen dd8774389e remove 32-bit workarounds
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-11-02 11:13:34 +07:00
Daniel Kesselberg 95ec67ecd7
Fix docblock for addFileFromStream
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2022-05-24 22:05:59 +07:00
Unpublished 854890a734 Add X-Accel-Buffering header to downloads
Signed-off-by: Unpublished <unpublished@gmx.net>
2022-01-17 08:17:12 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
szaimen 35d978c2fc Rename External storages to External storage
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-05-20 12:13:04 +07:00
Roeland Jago Douma ab6bd79c02
Only disable zip64 if the size is known
Else we might run into the issue that for an external storage where the
size is not known yet we do not use zip64. Which then of course fails on
large zip files.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-01 15:01:12 +07:00
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +07:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +07:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +07:00
Christoph Wurst 1b46621cd3
Update license headers for 18
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-20 09:23:25 +07:00
Arthur Schiwon af91efd315
when downloading from web, skip files that are not accessible
* avoids a 403, but enables download of resources that are not restricted
* single file downloads still cause 403

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-12-19 13:05:10 +07:00
Arthur Schiwon 79eae96f45
use Nodes API for zip streaming
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-12-19 13:05:09 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Daniel Calviño Sánchez 90fdf83ca7
Use zip32 only if there are less than 65536 files
A zip32 file can contain, at most, 65535 files (and folders), so take
that constraint into account.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-06 15:59:30 +07:00
Roeland Jago Douma 4a73f645e5
Use zip32 if possible
* OSX doesn't handle 64zip that well
* Some other implentations don't handle it perfectly either
* If the file is belog 4GiB (some overhead) => zip32
* This covers the 99% case I bet

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-06 15:59:30 +07:00
Joas Schilling 7d806bdfbd Revert "Always enable Zip64 extension for zipstreamer" 2017-06-09 10:21:26 +07:00
Nicolai Ehemann 619afd499e Always enable Zip64 extension for zipstreamer
Signed-off-by: Nicolai Ehemann <en@enlightened.de>
2017-05-25 22:30:03 +07:00
Joas Schilling 6b8c45d05a
Add doc block for $time
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-28 14:26:30 +07:00
Joas Schilling d2ff6c569e
Keep the filemtime for files when downloading them in a zip/tar
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-28 11:36:10 +07:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +07:00
Roeland Jago Douma f52c5b31b6
Move more from \OC to PSR-4
* \OC\OCSClient
* \OC\Preview
* \OC\PreviewManager
* \OC\Repair
* \OC\RepairException
* \OC\Search
* \OC\ServerContainer
* \OC\ServerNotAvailableException
* \OC\ServiceUnavailableException
* \OC\Setup
* \OC\Streamer
* \OC\SubAdmin
* \OC\SystemConfig
* \OC\TagManager
* \OC\Tags
* \OC\TempManager
* \OC\TemplateLayout
* \OC\URLGenerator
* \OC\Updater
2016-04-29 15:08:01 +07:00