summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php17
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/l10n/sk.js16
-rw-r--r--lib/l10n/sk.json16
-rw-r--r--lib/private/App/AppManager.php1
-rw-r--r--lib/private/Authentication/Token/DefaultTokenProvider.php2
-rw-r--r--lib/private/Comments/Comment.php2
-rw-r--r--lib/private/DB/MissingIndexInformation.php39
-rw-r--r--lib/private/Files/Storage/Wrapper/Quota.php3
-rw-r--r--lib/private/Log.php10
-rw-r--r--lib/private/legacy/app.php2
-rw-r--r--lib/public/App/IAppManager.php1
-rw-r--r--lib/public/IDBConnection.php1
14 files changed, 103 insertions, 9 deletions
diff --git a/lib/base.php b/lib/base.php
index 57a620db0ec..5cc33e233f9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -523,11 +523,18 @@ class OC {
// specifications. For those, have an automated opt-out. Since the protection
// for remote.php is applied in base.php as starting point we need to opt out
// here.
- $incompatibleUserAgents = [
- // OS X Finder
- '/^WebDAVFS/',
- '/^Microsoft-WebDAV-MiniRedir/',
- ];
+ $incompatibleUserAgents = \OC::$server->getConfig()->getSystemValue('csrf.optout');
+
+ // Fallback, if csrf.optout is unset
+ if (!is_array($incompatibleUserAgents)) {
+ $incompatibleUserAgents = [
+ // OS X Finder
+ '/^WebDAVFS/',
+ // Windows webdav drive
+ '/^Microsoft-WebDAV-MiniRedir/',
+ ];
+ }
+
if($request->isUserAgent($incompatibleUserAgents)) {
return;
}
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index b5b8e2b1696..701f723468d 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -579,6 +579,7 @@ return array(
'OC\\DB\\MigrationException' => $baseDir . '/lib/private/DB/MigrationException.php',
'OC\\DB\\MigrationService' => $baseDir . '/lib/private/DB/MigrationService.php',
'OC\\DB\\Migrator' => $baseDir . '/lib/private/DB/Migrator.php',
+ 'OC\\DB\\MissingIndexInformation' => $baseDir . '/lib/private/DB/MissingIndexInformation.php',
'OC\\DB\\MySQLMigrator' => $baseDir . '/lib/private/DB/MySQLMigrator.php',
'OC\\DB\\MySqlTools' => $baseDir . '/lib/private/DB/MySqlTools.php',
'OC\\DB\\OCSqlitePlatform' => $baseDir . '/lib/private/DB/OCSqlitePlatform.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 3e0bff2bd66..da4556a7185 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -609,6 +609,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\DB\\MigrationException' => __DIR__ . '/../../..' . '/lib/private/DB/MigrationException.php',
'OC\\DB\\MigrationService' => __DIR__ . '/../../..' . '/lib/private/DB/MigrationService.php',
'OC\\DB\\Migrator' => __DIR__ . '/../../..' . '/lib/private/DB/Migrator.php',
+ 'OC\\DB\\MissingIndexInformation' => __DIR__ . '/../../..' . '/lib/private/DB/MissingIndexInformation.php',
'OC\\DB\\MySQLMigrator' => __DIR__ . '/../../..' . '/lib/private/DB/MySQLMigrator.php',
'OC\\DB\\MySqlTools' => __DIR__ . '/../../..' . '/lib/private/DB/MySqlTools.php',
'OC\\DB\\OCSqlitePlatform' => __DIR__ . '/../../..' . '/lib/private/DB/OCSqlitePlatform.php',
diff --git a/lib/l10n/sk.js b/lib/l10n/sk.js
index e7db8d4d111..da96d01229f 100644
--- a/lib/l10n/sk.js
+++ b/lib/l10n/sk.js
@@ -27,6 +27,7 @@ OC.L10N.register(
"Following platforms are supported: %s" : "Podporované sú nasledovné systémy: %s",
"Server version %s or higher is required." : "Je vyžadovaná verzia servera %s alebo vyššia.",
"Server version %s or lower is required." : "Je vyžadovaná verzia servera %s alebo nižšia.",
+ "Logged in user must be an admin" : "Prihlásený používateľ musí byť správca",
"Unknown filetype" : "Neznámy typ súboru",
"Invalid image" : "Chybný obrázok",
"Avatar image is not square" : "Obrázok avatara nie je štvorcový",
@@ -68,8 +69,10 @@ OC.L10N.register(
"APCu" : "APCu",
"Redis" : "Redis",
"Create" : "Vytvoriť",
+ "Change" : "Zmeniť",
"Delete" : "Zmazať",
"Share" : "Zdieľať",
+ "Overview" : "Prehľad",
"Basic settings" : "Základné nastavenia",
"Sharing" : "Sprístupnenie",
"Security" : "Zabezpečenie",
@@ -77,6 +80,7 @@ OC.L10N.register(
"Additional settings" : "Ďalšie nastavenia",
"Tips & tricks" : "Tipy a triky",
"Personal info" : "Osobné informácie",
+ "Mobile & desktop" : "Mobil a počítač",
"Unlimited" : "Neobmedzené",
"Verifying" : "Overovanie",
"Verifying …" : "Overovanie ...",
@@ -231,6 +235,18 @@ OC.L10N.register(
"Storage is temporarily not available" : "Úložisko je dočasne nedostupné",
"Storage connection timeout. %s" : "Vypršanie pripojenia k úložisku. %s",
"Personal" : "Osobné",
+ "Admin" : "Admi",
+ "DB Error: \"%s\"" : "Chyba databázy: \"%s\"",
+ "Offending command was: \"%s\"" : "Problémový príkaz bol: \"%s\"",
+ "Offending command was: \"%s\", name: %s, password: %s" : "Problémový príkaz bol: \"%s\", meno: %s, heslo: %s",
+ "Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Nastavenie povolení pre %s zlyhalo, pretože povolenia prekračujú povolenia udelené %s",
+ "Setting permissions for %s failed, because the item was not found" : "Nastavenie povolení pre %s zlyhalo, pretože položka sa nenašla",
+ "Cannot clear expiration date. Shares are required to have an expiration date." : "Nemožno vymazať čas exspirácie. Pri sprístupnení je čas exspirácie vyžadovaný.",
+ "Cannot increase permissions of %s" : "Nie je možné navýšiť oprávnenia pre %s",
+ "Files can't be shared with delete permissions" : "Súbory nie je možné sprístupňovať s oprávneniami na odstránenie",
+ "Files can't be shared with create permissions" : "Súbory nie je možné sprístupňovať s oprávneniami na vytváranie",
+ "Cannot set expiration date more than %s days in the future" : "Nie je možné nastaviť dátum konca platnosti viac ako %s dní v budúcnosti",
+ "No app name specified" : "Nešpecifikované meno aplikácie",
"App '%s' could not be installed!" : "Aplikáciu '%s' nebolo možné nainštalovať!",
"Sync clients" : "Klienti synchronizácie"
},
diff --git a/lib/l10n/sk.json b/lib/l10n/sk.json
index 64a3e5f424f..3f95fc88660 100644
--- a/lib/l10n/sk.json
+++ b/lib/l10n/sk.json
@@ -25,6 +25,7 @@
"Following platforms are supported: %s" : "Podporované sú nasledovné systémy: %s",
"Server version %s or higher is required." : "Je vyžadovaná verzia servera %s alebo vyššia.",
"Server version %s or lower is required." : "Je vyžadovaná verzia servera %s alebo nižšia.",
+ "Logged in user must be an admin" : "Prihlásený používateľ musí byť správca",
"Unknown filetype" : "Neznámy typ súboru",
"Invalid image" : "Chybný obrázok",
"Avatar image is not square" : "Obrázok avatara nie je štvorcový",
@@ -66,8 +67,10 @@
"APCu" : "APCu",
"Redis" : "Redis",
"Create" : "Vytvoriť",
+ "Change" : "Zmeniť",
"Delete" : "Zmazať",
"Share" : "Zdieľať",
+ "Overview" : "Prehľad",
"Basic settings" : "Základné nastavenia",
"Sharing" : "Sprístupnenie",
"Security" : "Zabezpečenie",
@@ -75,6 +78,7 @@
"Additional settings" : "Ďalšie nastavenia",
"Tips & tricks" : "Tipy a triky",
"Personal info" : "Osobné informácie",
+ "Mobile & desktop" : "Mobil a počítač",
"Unlimited" : "Neobmedzené",
"Verifying" : "Overovanie",
"Verifying …" : "Overovanie ...",
@@ -229,6 +233,18 @@
"Storage is temporarily not available" : "Úložisko je dočasne nedostupné",
"Storage connection timeout. %s" : "Vypršanie pripojenia k úložisku. %s",
"Personal" : "Osobné",
+ "Admin" : "Admi",
+ "DB Error: \"%s\"" : "Chyba databázy: \"%s\"",
+ "Offending command was: \"%s\"" : "Problémový príkaz bol: \"%s\"",
+ "Offending command was: \"%s\", name: %s, password: %s" : "Problémový príkaz bol: \"%s\", meno: %s, heslo: %s",
+ "Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Nastavenie povolení pre %s zlyhalo, pretože povolenia prekračujú povolenia udelené %s",
+ "Setting permissions for %s failed, because the item was not found" : "Nastavenie povolení pre %s zlyhalo, pretože položka sa nenašla",
+ "Cannot clear expiration date. Shares are required to have an expiration date." : "Nemožno vymazať čas exspirácie. Pri sprístupnení je čas exspirácie vyžadovaný.",
+ "Cannot increase permissions of %s" : "Nie je možné navýšiť oprávnenia pre %s",
+ "Files can't be shared with delete permissions" : "Súbory nie je možné sprístupňovať s oprávneniami na odstránenie",
+ "Files can't be shared with create permissions" : "Súbory nie je možné sprístupňovať s oprávneniami na vytváranie",
+ "Cannot set expiration date more than %s days in the future" : "Nie je možné nastaviť dátum konca platnosti viac ako %s dní v budúcnosti",
+ "No app name specified" : "Nešpecifikované meno aplikácie",
"App '%s' could not be installed!" : "Aplikáciu '%s' nebolo možné nainštalovať!",
"Sync clients" : "Klienti synchronizácie"
},"pluralForm" :"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);"
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 4d0859b1988..94addb2b785 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -323,6 +323,7 @@ class AppManager implements IAppManager {
public function clearAppsCache() {
$settingsMemCache = $this->memCacheFactory->createDistributed('settings');
$settingsMemCache->clear('listApps');
+ $this->appInfos = [];
}
/**
diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php
index 5df74cadac4..7a43dbb23e1 100644
--- a/lib/private/Authentication/Token/DefaultTokenProvider.php
+++ b/lib/private/Authentication/Token/DefaultTokenProvider.php
@@ -171,7 +171,7 @@ class DefaultTokenProvider implements IProvider {
throw new InvalidTokenException();
}
- if ($token->getExpires() !== null && $token->getExpires() < $this->time->getTime()) {
+ if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) {
throw new ExpiredTokenException($token);
}
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php
index dd790c2e50a..94c43be622b 100644
--- a/lib/private/Comments/Comment.php
+++ b/lib/private/Comments/Comment.php
@@ -225,7 +225,7 @@ class Comment implements IComment {
*
*/
public function getMentions() {
- $ok = preg_match_all('/\B@[a-z0-9_\-@\.\']+/i', $this->getMessage(), $mentions);
+ $ok = preg_match_all("/\B(?<![^a-z0-9_\-@\.\'\s])@[a-z0-9_\-@\.\']+/i", $this->getMessage(), $mentions);
if(!$ok || !isset($mentions[0]) || !is_array($mentions[0])) {
return [];
}
diff --git a/lib/private/DB/MissingIndexInformation.php b/lib/private/DB/MissingIndexInformation.php
new file mode 100644
index 00000000000..d6e40e0b09e
--- /dev/null
+++ b/lib/private/DB/MissingIndexInformation.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * @copyright Copyright (c) 2018 Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\DB;
+
+
+class MissingIndexInformation {
+
+ private $listOfMissingIndexes = [];
+
+ public function addHintForMissingSubject($tableName, $indexName) {
+ $this->listOfMissingIndexes[] = [
+ 'tableName' => $tableName,
+ 'indexName' => $indexName
+ ];
+ }
+
+ public function getListOfMissingIndexes() {
+ return $this->listOfMissingIndexes;
+ }
+} \ No newline at end of file
diff --git a/lib/private/Files/Storage/Wrapper/Quota.php b/lib/private/Files/Storage/Wrapper/Quota.php
index a7d5f3101fe..860fce57277 100644
--- a/lib/private/Files/Storage/Wrapper/Quota.php
+++ b/lib/private/Files/Storage/Wrapper/Quota.php
@@ -202,7 +202,8 @@ class Quota extends Wrapper {
}
public function mkdir($path) {
- if ($this->quota === 0.0) {
+ $free = $this->free_space($path);
+ if ($free === 0.0) {
return false;
}
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 69705c49e87..4170acbb69a 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -233,8 +233,16 @@ class Log implements ILogger {
if (isset($logCondition['shared_secret'])) {
$request = \OC::$server->getRequest();
+ if ($request->getMethod() === 'PUT' &&
+ strpos($request->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false &&
+ strpos($request->getHeader('Content-Type'), 'application/json') === false) {
+ $logSecretRequest = '';
+ } else {
+ $logSecretRequest = $request->getParam('log_secret', '');
+ }
+
// if token is found in the request change set the log condition to satisfied
- if ($request && hash_equals($logCondition['shared_secret'], $request->getParam('log_secret', ''))) {
+ if ($request && hash_equals($logCondition['shared_secret'], $logSecretRequest)) {
$this->logConditionSatisfied = true;
}
}
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 70f1b16e3c6..0a5d31a9873 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -887,6 +887,7 @@ class OC_App {
}
self::registerAutoloading($appId, $appPath);
+ \OC::$server->getAppManager()->clearAppsCache();
$appData = self::getAppInfo($appId);
self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']);
@@ -900,6 +901,7 @@ class OC_App {
self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']);
self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']);
// update appversion in app manager
+ \OC::$server->getAppManager()->clearAppsCache();
\OC::$server->getAppManager()->getAppVersion($appId, false);
// run upgrade code
diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php
index 4840d71d756..b0d04500f35 100644
--- a/lib/public/App/IAppManager.php
+++ b/lib/public/App/IAppManager.php
@@ -100,6 +100,7 @@ interface IAppManager {
*
* @param string $appId
* @param \OCP\IGroup[] $groups
+ * @throws \Exception
* @since 8.0.0
*/
public function enableAppForGroups($appId, $groups);
diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php
index 024e759de6e..4e450eae736 100644
--- a/lib/public/IDBConnection.php
+++ b/lib/public/IDBConnection.php
@@ -47,6 +47,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
interface IDBConnection {
const ADD_MISSING_INDEXES_EVENT = self::class . '::ADD_MISSING_INDEXES';
+ const CHECK_MISSING_INDEXES_EVENT = self::class . '::CHECK_MISSING_INDEXES';
/**
* Gets the QueryBuilder for the connection.