summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/AppFramework/Http/Request.php2
-rw-r--r--lib/private/Settings/Admin/Sharing.php1
-rw-r--r--lib/private/Template/JSCombiner.php2
-rw-r--r--lib/private/Template/JSConfigHelper.php4
4 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index fd43d468568..3f1e6fd951a 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -401,6 +401,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
protected function getContent() {
// If the content can't be parsed into an array then return a stream resource.
if ($this->method === 'PUT'
+ && $this->getHeader('Content-Length') !== 0
+ && $this->getHeader('Content-Length') !== null
&& strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false
&& strpos($this->getHeader('Content-Type'), 'application/json') === false
) {
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php
index 9b17efa8028..8f57f77b20a 100644
--- a/lib/private/Settings/Admin/Sharing.php
+++ b/lib/private/Settings/Admin/Sharing.php
@@ -64,6 +64,7 @@ class Sharing implements ISettings {
'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false,
'shareExcludedGroupsList' => $excludeGroupsList,
'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null),
+ 'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'),
];
return new TemplateResponse('settings', 'admin/sharing', $parameters, '');
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php
index 77c46a5e45e..604cd2cceb7 100644
--- a/lib/private/Template/JSCombiner.php
+++ b/lib/private/Template/JSCombiner.php
@@ -98,7 +98,7 @@ class JSCombiner {
$fileName = str_replace('.json', '.js', $fileName) . '.deps';
try {
$deps = $this->depsCache->get($folder->getName() . '-' . $fileName);
- if ($deps === null) {
+ if ($deps === null || $deps === '') {
$depFile = $folder->getFile($fileName);
$deps = $depFile->getContent();
$this->depsCache->set($folder->getName() . '-' . $fileName, $deps);
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index ca45bbee9c6..4fc21680211 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -112,6 +112,9 @@ class JSConfigHelper {
$apps_paths[$app] = \OC_App::getAppWebPath($app);
}
+
+ $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
+ $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
$defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
$defaultExpireDate = $enforceDefaultExpireDate = null;
if ($defaultExpireDateEnabled) {
@@ -217,6 +220,7 @@ class JSConfigHelper {
'defaultExpireDate' => $defaultExpireDate,
'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
+ 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault,
'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,