diff options
author | Markus Goetz <markus@woboq.com> | 2017-01-20 17:46:04 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-17 00:06:31 -0600 |
commit | 075a6065141e2412454699ca8e7fca558c5b6b4f (patch) | |
tree | 8ea8719d63737ce828b97a1c6c468fb6b2ba5b55 /apps/dav/lib/Upload | |
parent | 39afcbd49feb4ba333746762fe7c9d4701db9860 (diff) | |
download | nextcloud-server-075a6065141e2412454699ca8e7fca558c5b6b4f.tar.gz nextcloud-server-075a6065141e2412454699ca8e7fca558c5b6b4f.zip |
Chunking NG: Assemble in natural sort order of files
For https://github.com/owncloud/client/pull/5476
Before this, the assembly could be bogusly in the order 0,1,10,11,2,3 etc.
As per the spec "The name of every chunk should be its chunk number."
https://github.com/cernbox/smashbox/blob/master/protocol/chunking.md
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav/lib/Upload')
-rw-r--r-- | apps/dav/lib/Upload/AssemblyStream.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php index 3a18f91677d..b623f717b31 100644 --- a/apps/dav/lib/Upload/AssemblyStream.php +++ b/apps/dav/lib/Upload/AssemblyStream.php @@ -67,7 +67,7 @@ class AssemblyStream implements \Icewind\Streams\File { $nodes = $this->nodes; // http://stackoverflow.com/a/10985500 @usort($nodes, function(IFile $a, IFile $b) { - return strcmp($a->getName(), $b->getName()); + return strnatcmp($a->getName(), $b->getName()); }); $this->nodes = $nodes; |