summaryrefslogtreecommitdiffstats
path: root/apps/files_external/service/globalstoragesservice.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-08 13:55:10 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-08 13:55:10 +0200
commitc3c50fb481318c5f2ab3b554dd12c84983b916e8 (patch)
tree701a0755b92869827f0d81faa1f7871b90c6e04a /apps/files_external/service/globalstoragesservice.php
parentc12dd2820ca8e4d989a8e4208cefb8b72a0f21fe (diff)
downloadnextcloud-server-c3c50fb481318c5f2ab3b554dd12c84983b916e8.tar.gz
nextcloud-server-c3c50fb481318c5f2ab3b554dd12c84983b916e8.zip
Fix language level incompatibilties
Arbitrary expressions in empty are allowed in PHP 5.5 ands upwards. Seems to only affect master. Fixed https://github.com/owncloud/core/issues/15463
Diffstat (limited to 'apps/files_external/service/globalstoragesservice.php')
-rw-r--r--apps/files_external/service/globalstoragesservice.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_external/service/globalstoragesservice.php b/apps/files_external/service/globalstoragesservice.php
index 011730390b0..7df0f73f652 100644
--- a/apps/files_external/service/globalstoragesservice.php
+++ b/apps/files_external/service/globalstoragesservice.php
@@ -101,6 +101,7 @@ class GlobalStoragesService extends StoragesService {
* @param string $signal signal to trigger
*/
protected function triggerHooks(StorageConfig $storage, $signal) {
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
$applicableUsers = $storage->getApplicableUsers();
$applicableGroups = $storage->getApplicableGroups();
if (empty($applicableUsers) && empty($applicableGroups)) {
@@ -149,8 +150,11 @@ class GlobalStoragesService extends StoragesService {
$groupAdditions = array_diff($newStorage->getApplicableGroups(), $oldStorage->getApplicableGroups());
$groupDeletions = array_diff($oldStorage->getApplicableGroups(), $newStorage->getApplicableGroups());
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
// if no applicable were set, raise a signal for "all"
- if (empty($oldStorage->getApplicableUsers()) && empty($oldStorage->getApplicableGroups())) {
+ $oldApplicableUsers = $oldStorage->getApplicableUsers();
+ $oldApplicableGroups = $oldStorage->getApplicableGroups();
+ if (empty($oldApplicableUsers) && empty($oldApplicableGroups)) {
$this->triggerApplicableHooks(
Filesystem::signal_delete_mount,
$oldStorage->getMountPoint(),
@@ -191,8 +195,11 @@ class GlobalStoragesService extends StoragesService {
$groupAdditions
);
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
// if no applicable, raise a signal for "all"
- if (empty($newStorage->getApplicableUsers()) && empty($newStorage->getApplicableGroups())) {
+ $newApplicableUsers = $newStorage->getApplicableUsers();
+ $newApplicableGroups = $newStorage->getApplicableGroups();
+ if (empty($newApplicableUsers) && empty($newApplicableGroups)) {
$this->triggerApplicableHooks(
Filesystem::signal_create_mount,
$newStorage->getMountPoint(),