From 6f9d6893a7cb31725df4b778aa07be2699dc67da Mon Sep 17 00:00:00 2001 From: nadir Date: Thu, 7 Apr 2016 09:36:24 +0200 Subject: [PATCH] [Patch] PHP Type fixes on ocs api share by link --- apps/files_sharing/api/linkshareexecutor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/files_sharing/api/linkshareexecutor.php b/apps/files_sharing/api/linkshareexecutor.php index e7135ca85b87..43aae5370c27 100644 --- a/apps/files_sharing/api/linkshareexecutor.php +++ b/apps/files_sharing/api/linkshareexecutor.php @@ -19,8 +19,8 @@ public function __construct($path) $this->shareWith = isset($_POST['password']) ? $_POST['password'] : null; //check public link share $this->publicUploadEnabled = \OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes'? TRUE : FALSE; - if(isset($_POST['publicUpload']) && $this->publicUploadEnabled) { - throw new Exception("public upload disabled by the administrator"); + if(isset($_POST['publicUpload']) && !$this->publicUploadEnabled) { + throw new \Exception("public upload disabled by the administrator"); } $this->publicUpload = isset($_POST['publicUpload']) ? ($_POST['publicUpload'] === 'true'? TRUE : FALSE) : FALSE; @@ -67,7 +67,7 @@ public function checkFileIntegrity() } if ($this->itemType === 'folder') { - $path = '/' . $uidOwner . '/files' . $this->path . '/'; + $path = '/' . $this->uidOwner . '/files' . $this->path . '/'; $mountManager = \OC\Files\Filesystem::getMountManager(); $mounts = $mountManager->findIn($path); foreach ($mounts as $mount) { @@ -91,7 +91,7 @@ public function checkFileIntegrity() public function checkForPreviousShares() { $updateExistingShare = false; - if (\OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes') == 'yes') { + if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_links', 'yes') == 'yes') { // when updating a link share // FIXME Don't delete link if we update it