Commit graph

19242 commits

Author SHA1 Message Date
Naoto Kobayashi
cbccddcf6e OC_Util::isNonUTF8Locale: fix lint error
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-17 09:01:41 +00:00
Naoto Kobayashi
b01048bafc OC_Util::isSetLocaleWorking: fix typo
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-17 09:01:40 +00:00
Naoto Kobayashi
b9b1ef1319 OC_Util: Add fallbacks to check if current locale is UTF8
Using escapeshellcmd to get current locale causes error
if the function is disabled.

Add fallbacks to prevent the error.

Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-17 09:01:40 +00:00
Naoto Kobayashi
516cc3ba18 Check whether setlocale works only after setlocale
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-17 09:01:40 +00:00
Naoto Kobayashi
e9c6de5c79 Fix missing setlocale with php 8
When php version = 8, basename('§') does not bug even if LC_ALL is non-UTF-8 locale.
This cause OC_Util::isSetLocaleWorking() to skip setlocale("C.UTF-8").

Fix it by using escapeshellcmd instead of basename.

Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-17 09:01:40 +00:00
Nextcloud bot
f5b155266d
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-17 02:45:55 +00:00
Joas Schilling
96c8e0dad3
Apply changes from master's update to 3.1.3
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 19:07:11 +01:00
Joas Schilling
d6d4cbbf9f
Allow NULL as well for limit, not integer only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 19:01:46 +01:00
Nextcloud bot
a05f4ed802
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-15 02:24:51 +00:00
Nextcloud bot
232d6dbc40
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-14 02:26:00 +00:00
Nextcloud bot
21fb91110b
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-13 02:26:07 +00:00
Joas Schilling
fd30500a92 Fix updating with apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-11 13:45:54 +00:00
Nextcloud bot
e955240667
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-10 02:24:50 +00:00
Côme Chilliet
5041b727b1
Merge pull request #29520 from nextcloud/backport/29479/stable21
[stable21] Fix images on php 8.0
2021-11-08 11:57:23 +01:00
Nextcloud bot
5815512308
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-08 02:33:28 +00:00
Nextcloud bot
4dc86b3259
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-07 02:22:53 +00:00
Nextcloud bot
e04a3a472a
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-06 02:22:58 +00:00
Nextcloud bot
14bffac3ae
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-05 02:23:14 +00:00
John Molakvoæ
5b89d34397
Revert "[21] tell mysql to ignore the sort index for search queries" 2021-11-04 11:10:46 +01:00
Côme Chilliet
dde1880be7
Merge branch 'stable21' into backport/29479/stable21
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-04 09:21:48 +01:00
John Molakvoæ
07c20b4f22
Merge pull request #29322 from nextcloud/mysql-search-ignore-index-21 2021-11-04 09:00:16 +01:00
John Molakvoæ
8469b44d57
Merge pull request #29507 from nextcloud/backport/29281/stable21 2021-11-04 08:51:37 +01:00
Nextcloud bot
9c13685ad4
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-03 02:23:54 +00:00
Côme Chilliet
23aa60bb8d
Fix resource usages in OC_Image
This makes sure using resource or GdImage (PHP>=8) behaves the same.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-02 11:49:13 +01:00
Nextcloud bot
4698a29825
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-11-02 02:22:34 +00:00
Sijmen Schoon
43e829a93e Move query outside the loop and reduce chunk size to 1000
This involved changing CacheQueryBuilder\whereParentIn to take a
parameter name, renaming the function accordingly.

Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-11-01 11:27:36 +00:00
Sijmen Schoon
bb198c635f Limit parameter count per query in Cache.removeChildren
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-11-01 11:27:36 +00:00
MichaIng
e250aef6b4
Merge pull request #29416 from nextcloud/backport/27440/stable21
[stable21] Handle files with `is_file` instead of `file_exists`
2021-10-30 00:19:35 +02:00
Carl Schwan
00a9b0c1db Fix permissions when copying from ObjectStorage
Make sure that when a user copy a file from a directory they don't have
all permissions to a directory where they have more permissions, the
permissions are correctly set to the one from the parent taget folder.

This was caused by the ObjectStoreStorage::copyFromStorage using
the jailed storage and cache entry instead of the unjailed one like other
storages (the local one).
Steps to reproduce

+ Use object storage
+ Create a groupfolder with one group having full permission and another one
  who can just read files.
+ With an user who is in the second group, copy a file from the groupfolder to
  the home folder of this user.
+ The file in the home folder of the user will be read only and can't be deleted
  even though it is in their home folder and they are the owner. In oc_filecache,
  the permissions stored for this file are 1 (READ)

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-10-28 12:55:53 +00:00
Robin Appelman
99ba96524e
more reliable return value for Watcher::checkUpdate
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-26 14:45:08 +02:00
Robin Appelman
f18a76fec9
s3 external storage listing rework
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-26 14:41:46 +02:00
Nextcloud bot
c89eaec9e4
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-26 02:23:16 +00:00
Nextcloud bot
082d429c6e
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-25 02:22:42 +00:00
MichaIng
a17529b483
Merge pull request #29399 from nextcloud/backport/29378/stable21
[stable21] Make the route name error more helpful
2021-10-23 20:12:44 +02:00
acsfer
eea1c23719 Handle files with is_file instead of file_exists
Should fix things like `fread(): read of 8192 bytes failed with errno=21 Is a directory`
2021-10-23 09:28:25 +00:00
Nextcloud bot
a87643a9e0
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-23 02:22:54 +00:00
Christoph Wurst
48d97fa865 Make the route name error more helpful
As a developer I have no clue what "Invalid route name" means. If the
exception gives me a hint I might find it easier to figure out why my
route triggers this error.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 20:38:58 +00:00
Vincent Petry
a080c08d64
Merge pull request #29367 from nextcloud/backport/29362/stable21
[stable21] Fix security issues when copying groupfolder with advanced ACL
2021-10-22 09:56:21 +02:00
Nextcloud bot
884fcf0227
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-22 02:22:17 +00:00
Carl Schwan
ec8b2a90e6 Fix security issues when copying groupfolder with advanced ACL
Using advanced ACL, it is possible that an user has access to a
directory but not to a subdirectory, so the copying use
Common::copyFromStorage instead of Local::copyFromStorage.

Fix https://github.com/nextcloud/groupfolders/issues/1692

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-10-21 16:34:46 +00:00
John Molakvoæ
6b0bdf192c
Merge pull request #29289 from nextcloud/backport/28768/stable21 2021-10-21 09:32:32 +02:00
Nextcloud bot
8a5317cbfe
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-21 02:24:37 +00:00
Nextcloud bot
8191ee34f2
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2021-10-20 02:43:22 +00:00
John Molakvoæ
1493321401
Merge pull request #29182 from nextcloud/backport/29028/stable21 2021-10-19 11:11:20 +02:00
Joas Schilling
2f6bd56c93
Fix app upgrade
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-19 08:47:52 +02:00
Robin Appelman
5002bf9cc1
tell mysql to ignore the sort index for search queries
mysql really likes to pick an index for sorting if it can't fully satisfy the where
filter with an index, since search queries pretty much never are fully filtered by index
mysql often picks an index for sorting instead of the *much* more useful index for filtering.

To bypass this, we tell mysql explicitly not to use the mtime (the default order field) index,
so it will instead pick an index that is actually useful.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-18 18:05:48 +02:00
Robin Appelman
7f272dd98f
allow specifying index hints for mysql search queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-18 18:03:34 +02:00
acsfer
f57bbaf146 Simplify :) 2021-10-18 08:02:44 +00:00
acsfer
aeb0ad8cea Replace file_exists() method by is_file() 2021-10-18 08:02:44 +00:00
acsfer
0c1ccde7d2 Get filesize() if file_exists()
Should make sense.
2021-10-18 08:02:44 +00:00