diff options
author | Lucas Azevedo <lhs_azevedo@hotmail.com> | 2023-08-28 12:25:01 -0300 |
---|---|---|
committer | Lucas Azevedo <lhs_azevedo@hotmail.com> | 2023-08-28 12:25:01 -0300 |
commit | 79bc6ba06cc19793c8bb1cf3b3dc231ae0dc1969 (patch) | |
tree | 91226f2f6fa52e506f9ba957946e15ff4906739b /lib | |
parent | cc912c3b51be06a7034c397a2b77d7968a28a7bd (diff) | |
parent | fc3eef9d2f0210729d3203ad857980cd621e0427 (diff) | |
download | nextcloud-server-79bc6ba06cc19793c8bb1cf3b3dc231ae0dc1969.tar.gz nextcloud-server-79bc6ba06cc19793c8bb1cf3b3dc231ae0dc1969.zip |
Merge branch 'master' into auth-token-commands
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/l10n/es.js | 1 | ||||
-rw-r--r-- | lib/l10n/es.json | 1 | ||||
-rw-r--r-- | lib/private/Calendar/Manager.php | 25 | ||||
-rw-r--r-- | lib/private/Share20/Manager.php | 24 | ||||
-rw-r--r-- | lib/public/AppFramework/Utility/ITimeFactory.php | 2 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IQueryBuilder.php | 11 |
8 files changed, 51 insertions, 15 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index a3397b6bdd0..704d59d000b 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1054,6 +1054,7 @@ return array( 'OC\\Core\\Command\\User\\Report' => $baseDir . '/core/Command/User/Report.php', 'OC\\Core\\Command\\User\\ResetPassword' => $baseDir . '/core/Command/User/ResetPassword.php', 'OC\\Core\\Command\\User\\Setting' => $baseDir . '/core/Command/User/Setting.php', + 'OC\\Core\\Command\\User\\SyncAccountDataCommand' => $baseDir . '/core/Command/User/SyncAccountDataCommand.php', 'OC\\Core\\Controller\\AppPasswordController' => $baseDir . '/core/Controller/AppPasswordController.php', 'OC\\Core\\Controller\\AutoCompleteController' => $baseDir . '/core/Controller/AutoCompleteController.php', 'OC\\Core\\Controller\\AvatarController' => $baseDir . '/core/Controller/AvatarController.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index efe39527313..fb3ef9ad3d0 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1087,6 +1087,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Core\\Command\\User\\Report' => __DIR__ . '/../../..' . '/core/Command/User/Report.php', 'OC\\Core\\Command\\User\\ResetPassword' => __DIR__ . '/../../..' . '/core/Command/User/ResetPassword.php', 'OC\\Core\\Command\\User\\Setting' => __DIR__ . '/../../..' . '/core/Command/User/Setting.php', + 'OC\\Core\\Command\\User\\SyncAccountDataCommand' => __DIR__ . '/../../..' . '/core/Command/User/SyncAccountDataCommand.php', 'OC\\Core\\Controller\\AppPasswordController' => __DIR__ . '/../../..' . '/core/Controller/AppPasswordController.php', 'OC\\Core\\Controller\\AutoCompleteController' => __DIR__ . '/../../..' . '/core/Controller/AutoCompleteController.php', 'OC\\Core\\Controller\\AvatarController' => __DIR__ . '/../../..' . '/core/Controller/AvatarController.php', diff --git a/lib/l10n/es.js b/lib/l10n/es.js index 3fd6c3f4412..62e1949ac57 100644 --- a/lib/l10n/es.js +++ b/lib/l10n/es.js @@ -262,6 +262,7 @@ OC.L10N.register( "Storage is temporarily not available" : "El almacenamiento no esta disponible temporalmente", "Storage connection timeout. %s" : "Tiempo de conexión de almacenamiento agotado. %s", "Free prompt" : "Prompt libre", + "Runs an arbitrary prompt through the language model." : "Ejecuta un prompt arbitrario mediante el modelo de lenguaje integrado.", "Generate headline" : "Generar titular", "Generates a possible headline for a text." : "Genera un posible titular para un texto.", "Summarize" : "Resumir", diff --git a/lib/l10n/es.json b/lib/l10n/es.json index 4a119d66057..34c7d6a19c9 100644 --- a/lib/l10n/es.json +++ b/lib/l10n/es.json @@ -260,6 +260,7 @@ "Storage is temporarily not available" : "El almacenamiento no esta disponible temporalmente", "Storage connection timeout. %s" : "Tiempo de conexión de almacenamiento agotado. %s", "Free prompt" : "Prompt libre", + "Runs an arbitrary prompt through the language model." : "Ejecuta un prompt arbitrario mediante el modelo de lenguaje integrado.", "Generate headline" : "Generar titular", "Generates a possible headline for a text." : "Genera un posible titular para un texto.", "Summarize" : "Resumir", diff --git a/lib/private/Calendar/Manager.php b/lib/private/Calendar/Manager.php index f29920e1793..dc4801c69ce 100644 --- a/lib/private/Calendar/Manager.php +++ b/lib/private/Calendar/Manager.php @@ -231,11 +231,20 @@ class Manager implements IManager { string $recipient, string $calendarData, ): bool { - /** @var VCalendar $vObject */ + /** @var VCalendar $vObject|null */ $vObject = Reader::read($calendarData); - /** @var VEvent $vEvent */ + + if ($vObject === null) { + return false; + } + + /** @var VEvent|null $vEvent */ $vEvent = $vObject->{'VEVENT'}; + if ($vEvent === null) { + return false; + } + // First, we check if the correct method is passed to us if (strcasecmp('REPLY', $vObject->{'METHOD'}->getValue()) !== 0) { $this->logger->warning('Wrong method provided for processing'); @@ -306,10 +315,20 @@ class Manager implements IManager { string $recipient, string $calendarData, ): bool { + /** @var VCalendar $vObject|null */ $vObject = Reader::read($calendarData); - /** @var VEvent $vEvent */ + + if ($vObject === null) { + return false; + } + + /** @var VEvent|null $vEvent */ $vEvent = $vObject->{'VEVENT'}; + if ($vEvent === null) { + return false; + } + // First, we check if the correct method is passed to us if (strcasecmp('CANCEL', $vObject->{'METHOD'}->getValue()) !== 0) { $this->logger->warning('Wrong method provided for processing'); diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 9360046bc24..b03608f9872 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1343,7 +1343,7 @@ class Manager implements IManager { $added = 0; foreach ($shares as $share) { try { - $this->checkExpireDate($share); + $this->checkShare($share); } catch (ShareNotFound $e) { //Ignore since this basically means the share is deleted continue; @@ -1402,7 +1402,7 @@ class Manager implements IManager { // remove all shares which are already expired foreach ($shares as $key => $share) { try { - $this->checkExpireDate($share); + $this->checkShare($share); } catch (ShareNotFound $e) { unset($shares[$key]); } @@ -1448,7 +1448,7 @@ class Manager implements IManager { $share = $provider->getShareById($id, $recipient); - $this->checkExpireDate($share); + $this->checkShare($share); return $share; } @@ -1532,7 +1532,7 @@ class Manager implements IManager { throw new ShareNotFound($this->l->t('The requested share does not exist anymore')); } - $this->checkExpireDate($share); + $this->checkShare($share); /* * Reduce the permissions for link or email shares if public upload is not enabled @@ -1545,11 +1545,25 @@ class Manager implements IManager { return $share; } - protected function checkExpireDate($share) { + /** + * Check expire date and disabled owner + * + * @throws ShareNotFound + */ + protected function checkShare(IShare $share): void { if ($share->isExpired()) { $this->deleteShare($share); throw new ShareNotFound($this->l->t('The requested share does not exist anymore')); } + if ($this->config->getAppValue('files_sharing', 'hide_disabled_user_shares', 'no') === 'yes') { + $uids = array_unique([$share->getShareOwner(),$share->getSharedBy()]); + foreach ($uids as $uid) { + $user = $this->userManager->get($uid); + if ($user?->isEnabled() === false) { + throw new ShareNotFound($this->l->t('The requested share comes from a disabled user')); + } + } + } } /** diff --git a/lib/public/AppFramework/Utility/ITimeFactory.php b/lib/public/AppFramework/Utility/ITimeFactory.php index 7a6acf97b2d..d4f74c9d107 100644 --- a/lib/public/AppFramework/Utility/ITimeFactory.php +++ b/lib/public/AppFramework/Utility/ITimeFactory.php @@ -41,7 +41,6 @@ interface ITimeFactory extends ClockInterface { /** * @return int the result of a call to time() * @since 8.0.0 - * @deprecated 26.0.0 {@see ITimeFactory::now()} */ public function getTime(): int; @@ -50,7 +49,6 @@ interface ITimeFactory extends ClockInterface { * @param \DateTimeZone|null $timezone * @return \DateTime * @since 15.0.0 - * @deprecated 26.0.0 {@see ITimeFactory::now()} */ public function getDateTime(string $time = 'now', \DateTimeZone $timezone = null): \DateTime; diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 1f5c4307914..63fdfb65971 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -28,6 +28,7 @@ namespace OCP\DB\QueryBuilder; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ParameterType; use OCP\DB\Exception; use OCP\DB\IResult; @@ -41,23 +42,23 @@ interface IQueryBuilder { /** * @since 9.0.0 */ - public const PARAM_NULL = \PDO::PARAM_NULL; + public const PARAM_NULL = ParameterType::NULL; /** * @since 9.0.0 */ - public const PARAM_BOOL = \PDO::PARAM_BOOL; + public const PARAM_BOOL = ParameterType::BOOLEAN; /** * @since 9.0.0 */ - public const PARAM_INT = \PDO::PARAM_INT; + public const PARAM_INT = ParameterType::INTEGER; /** * @since 9.0.0 */ - public const PARAM_STR = \PDO::PARAM_STR; + public const PARAM_STR = ParameterType::STRING; /** * @since 9.0.0 */ - public const PARAM_LOB = \PDO::PARAM_LOB; + public const PARAM_LOB = ParameterType::LARGE_OBJECT; /** * @since 9.0.0 */ |