summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorDaniel Rudolf <github.com@daniel-rudolf.de>2021-08-04 18:52:55 +0200
committerDaniel Rudolf <github.com@daniel-rudolf.de>2021-08-04 18:52:55 +0200
commitaa455e71d95c877b0dc758bc5c873d9278e6e112 (patch)
tree6f1135402c356f68cd940e0b2ca5efd1f8d91a67 /lib/public
parentb768cade2b2c6664851de6462a17ef3531305971 (diff)
parent2a632195365be77889428e85801a00c74ab6a836 (diff)
downloadnextcloud-server-aa455e71d95c877b0dc758bc5c873d9278e6e112.tar.gz
nextcloud-server-aa455e71d95c877b0dc758bc5c873d9278e6e112.zip
Merge branch 'master' into enhancement/noid/IURLGenerator-linkToDefaultPageUrl
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php2
-rw-r--r--lib/public/DB/QueryBuilder/IExpressionBuilder.php4
-rw-r--r--lib/public/Defaults.php9
-rw-r--r--lib/public/Encryption/Exceptions/GenericEncryptionException.php2
-rw-r--r--lib/public/Federation/Exceptions/ActionNotSupportedException.php2
-rw-r--r--lib/public/Federation/Exceptions/AuthenticationFailedException.php2
-rw-r--r--lib/public/Federation/Exceptions/BadRequestException.php2
-rw-r--r--lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php2
-rw-r--r--lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php2
-rw-r--r--lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php2
-rw-r--r--lib/public/Federation/ICloudIdManager.php4
-rw-r--r--lib/public/Files/Cache/ICache.php6
-rw-r--r--lib/public/Files/Storage/IStorage.php2
-rw-r--r--lib/public/Files/StorageNotAvailableException.php2
-rw-r--r--lib/public/HintException.php82
-rw-r--r--lib/public/IConfig.php4
-rw-r--r--lib/public/Search/Provider.php2
-rw-r--r--lib/public/Security/ISecureRandom.php1
-rw-r--r--lib/public/Share/Exceptions/GenericShareException.php2
19 files changed, 113 insertions, 21 deletions
diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
index 2f14f9b63e1..e0ef79049a4 100644
--- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
+++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
@@ -28,7 +28,7 @@ namespace OCP\AppFramework\Http;
/**
* Class EmptyContentSecurityPolicy is a simple helper which allows applications
- * to modify the Content-Security-Policy sent by ownCloud. Per default the policy
+ * to modify the Content-Security-Policy sent by Nexcloud. Per default the policy
* is forbidding everything.
*
* As alternative with sane exemptions look at ContentSecurityPolicy
diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
index b3dbf564e35..77701240d51 100644
--- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php
+++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
@@ -431,7 +431,7 @@ interface IExpressionBuilder {
/**
* Returns a IQueryFunction that casts the column to the given type
*
- * @param string $column
+ * @param string|IQueryFunction $column
* @param mixed $type One of IQueryBuilder::PARAM_*
* @return IQueryFunction
* @since 9.0.0
@@ -439,5 +439,5 @@ interface IExpressionBuilder {
* @psalm-taint-sink sql $column
* @psalm-taint-sink sql $type
*/
- public function castColumn(string $column, $type): IQueryFunction;
+ public function castColumn($column, $type): IQueryFunction;
}
diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php
index 7d74134cf48..7c6d73bcaea 100644
--- a/lib/public/Defaults.php
+++ b/lib/public/Defaults.php
@@ -95,6 +95,15 @@ class Defaults {
}
/**
+ * link to the Android client on F-Droid
+ * @return string
+ * @since 23.0.0
+ */
+ public function getFDroidClientUrl() {
+ return $this->defaults->getFDroidClientUrl();
+ }
+
+ /**
* base URL to the documentation of your ownCloud instance
* @return string
* @since 6.0.0
diff --git a/lib/public/Encryption/Exceptions/GenericEncryptionException.php b/lib/public/Encryption/Exceptions/GenericEncryptionException.php
index 9f349a28a76..aef4114bb1b 100644
--- a/lib/public/Encryption/Exceptions/GenericEncryptionException.php
+++ b/lib/public/Encryption/Exceptions/GenericEncryptionException.php
@@ -26,7 +26,7 @@
*/
namespace OCP\Encryption\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class GenericEncryptionException
diff --git a/lib/public/Federation/Exceptions/ActionNotSupportedException.php b/lib/public/Federation/Exceptions/ActionNotSupportedException.php
index 3ec729e415a..7b2ca3d9597 100644
--- a/lib/public/Federation/Exceptions/ActionNotSupportedException.php
+++ b/lib/public/Federation/Exceptions/ActionNotSupportedException.php
@@ -22,7 +22,7 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class ActionNotSupportedException
diff --git a/lib/public/Federation/Exceptions/AuthenticationFailedException.php b/lib/public/Federation/Exceptions/AuthenticationFailedException.php
index 61ea080f5d4..dfcd9636035 100644
--- a/lib/public/Federation/Exceptions/AuthenticationFailedException.php
+++ b/lib/public/Federation/Exceptions/AuthenticationFailedException.php
@@ -22,7 +22,7 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class AuthenticationFailedException
diff --git a/lib/public/Federation/Exceptions/BadRequestException.php b/lib/public/Federation/Exceptions/BadRequestException.php
index bea6fba2b18..8054c0e89f0 100644
--- a/lib/public/Federation/Exceptions/BadRequestException.php
+++ b/lib/public/Federation/Exceptions/BadRequestException.php
@@ -23,7 +23,7 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class BadRequestException
diff --git a/lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php b/lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php
index 48aa883a028..b6d4b7e9bce 100644
--- a/lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php
+++ b/lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php
@@ -24,7 +24,7 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class ProviderAlreadyExistsException
diff --git a/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php b/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php
index c647b2d9c9e..efcc8788386 100644
--- a/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php
+++ b/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php
@@ -22,8 +22,8 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
use OCP\AppFramework\Http;
+use OCP\HintException;
/**
* Class ProviderCouldNotAddShareException
diff --git a/lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php b/lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php
index b56a6ef8d4c..69c69f17d99 100644
--- a/lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php
+++ b/lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php
@@ -22,7 +22,7 @@
*/
namespace OCP\Federation\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class ProviderDoesNotExistsException
diff --git a/lib/public/Federation/ICloudIdManager.php b/lib/public/Federation/ICloudIdManager.php
index df7bd127baf..1612c03ba4a 100644
--- a/lib/public/Federation/ICloudIdManager.php
+++ b/lib/public/Federation/ICloudIdManager.php
@@ -46,12 +46,12 @@ interface ICloudIdManager {
* Get the cloud id for a remote user
*
* @param string $user
- * @param string $remote
+ * @param string|null $remote (optional since 23.0.0 for local users)
* @return ICloudId
*
* @since 12.0.0
*/
- public function getCloudId(string $user, string $remote): ICloudId;
+ public function getCloudId(string $user, ?string $remote): ICloudId;
/**
* Check if the input is a correctly formatted cloud id
diff --git a/lib/public/Files/Cache/ICache.php b/lib/public/Files/Cache/ICache.php
index 15b750ce7f0..e27f4207f1e 100644
--- a/lib/public/Files/Cache/ICache.php
+++ b/lib/public/Files/Cache/ICache.php
@@ -31,8 +31,8 @@ use OCP\Files\Search\ISearchQuery;
* The cache stores the metadata for all files and folders in a storage and is kept up to date trough the following mechanisms:
*
* - Scanner: scans the storage and updates the cache where needed
- * - Watcher: checks for changes made to the filesystem outside of the ownCloud instance and rescans files and folder when a change is detected
- * - Updater: listens to changes made to the filesystem inside of the ownCloud instance and updates the cache where needed
+ * - Watcher: checks for changes made to the filesystem outside of the Nextcloud instance and rescans files and folder when a change is detected
+ * - Updater: listens to changes made to the filesystem inside of the Nextcloud instance and updates the cache where needed
* - ChangePropagator: updates the mtime and etags of parent folders whenever a change to the cache is made to the cache by the updater
*
* @since 9.0.0
@@ -119,7 +119,7 @@ interface ICache {
/**
* get the file id for a file
*
- * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file
+ * A file id is a numeric id for a file or folder that's unique within an Nextcloud instance which stays the same for the lifetime of a file
*
* File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing
*
diff --git a/lib/public/Files/Storage/IStorage.php b/lib/public/Files/Storage/IStorage.php
index 3d9cf30294f..9f350f92b86 100644
--- a/lib/public/Files/Storage/IStorage.php
+++ b/lib/public/Files/Storage/IStorage.php
@@ -25,7 +25,7 @@
*
*/
// use OCP namespace for all classes that are considered public.
-// This means that they should be used by apps instead of the internal ownCloud classes
+// This means that they should be used by apps instead of the internal Nextcloud classes
namespace OCP\Files\Storage;
diff --git a/lib/public/Files/StorageNotAvailableException.php b/lib/public/Files/StorageNotAvailableException.php
index e166df90d77..f600ef80808 100644
--- a/lib/public/Files/StorageNotAvailableException.php
+++ b/lib/public/Files/StorageNotAvailableException.php
@@ -32,7 +32,7 @@
namespace OCP\Files;
-use OC\HintException;
+use OCP\HintException;
/**
* Storage is temporarily not available
diff --git a/lib/public/HintException.php b/lib/public/HintException.php
new file mode 100644
index 00000000000..b5ee7642b03
--- /dev/null
+++ b/lib/public/HintException.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ * @author Bart Visscher <bartv@thisnet.nl>
+ * @author Lukas Reschke <lukas@statuscode.ch>
+ * @author Michael Gapczynski <GapczynskiM@gmail.com>
+ * @author Thomas Müller <thomas.mueller@tmit.eu>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * 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, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+namespace OCP;
+
+/**
+ * Class HintException
+ *
+ * An Exception class with the intention to be presented to the end user
+ *
+ * @package OCP
+ * @since 23.0.0
+ */
+class HintException extends \Exception {
+ private $hint;
+
+ /**
+ * HintException constructor.
+ *
+ * @since 23.0.0
+ * @param string $message The error message. It will be not revealed to the
+ * the user (unless the hint is empty) and thus
+ * should be not translated.
+ * @param string $hint A useful message that is presented to the end
+ * user. It should be translated, but must not
+ * contain sensitive data.
+ * @param int $code
+ * @param \Exception|null $previous
+ */
+ public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) {
+ $this->hint = $hint;
+ parent::__construct($message, $code, $previous);
+ }
+
+ /**
+ * Returns a string representation of this Exception that includes the error
+ * code, the message and the hint.
+ *
+ * @since 23.0.0
+ * @return string
+ */
+ public function __toString(): string {
+ return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
+ }
+
+ /**
+ * Returns the hint with the intention to be presented to the end user. If
+ * an empty hint was specified upon instatiation, the message is returned
+ * instead.
+ *
+ * @since 23.0.0
+ * @return string
+ */
+ public function getHint(): string {
+ if (empty($this->hint)) {
+ return $this->message;
+ }
+ return $this->hint;
+ }
+}
diff --git a/lib/public/IConfig.php b/lib/public/IConfig.php
index 2a8399627e3..6b396624556 100644
--- a/lib/public/IConfig.php
+++ b/lib/public/IConfig.php
@@ -28,12 +28,12 @@
*
*/
// use OCP namespace for all classes that are considered public.
-// This means that they should be used by apps instead of the internal ownCloud classes
+// This means that they should be used by apps instead of the internal Nextcloud classes
namespace OCP;
/**
- * Access to all the configuration options ownCloud offers
+ * Access to all the configuration options Nextcloud offers.
* @since 6.0.0
*/
interface IConfig {
diff --git a/lib/public/Search/Provider.php b/lib/public/Search/Provider.php
index cf143b42dd8..2cf0c4d043b 100644
--- a/lib/public/Search/Provider.php
+++ b/lib/public/Search/Provider.php
@@ -27,7 +27,7 @@
namespace OCP\Search;
/**
- * Provides a template for search functionality throughout ownCloud;
+ * Provides a template for search functionality throughout Nextcloud;
* @since 7.0.0
* @deprecated 20.0.0
*/
diff --git a/lib/public/Security/ISecureRandom.php b/lib/public/Security/ISecureRandom.php
index 530a3b9df8f..250ecd25358 100644
--- a/lib/public/Security/ISecureRandom.php
+++ b/lib/public/Security/ISecureRandom.php
@@ -47,6 +47,7 @@ interface ISecureRandom {
public const CHAR_LOWER = 'abcdefghijklmnopqrstuvwxyz';
public const CHAR_DIGITS = '0123456789';
public const CHAR_SYMBOLS = '!\"#$%&\\\'()*+,-./:;<=>?@[\]^_`{|}~';
+ public const CHAR_ALPHANUMERIC = self::CHAR_UPPER . self::CHAR_LOWER . self::CHAR_DIGITS;
/**
* Characters that can be used for <code>generate($length, $characters)</code>, to
diff --git a/lib/public/Share/Exceptions/GenericShareException.php b/lib/public/Share/Exceptions/GenericShareException.php
index 46a46ac0ab7..85c440e2387 100644
--- a/lib/public/Share/Exceptions/GenericShareException.php
+++ b/lib/public/Share/Exceptions/GenericShareException.php
@@ -24,7 +24,7 @@
*/
namespace OCP\Share\Exceptions;
-use OC\HintException;
+use OCP\HintException;
/**
* Class GenericEncryptionException