diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/ClassLoader.php | 37 | ||||
-rw-r--r-- | lib/composer/composer/autoload_real.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/platform_check.php | 26 | ||||
-rw-r--r-- | lib/l10n/th.js | 2 | ||||
-rw-r--r-- | lib/l10n/th.json | 2 | ||||
-rw-r--r-- | lib/l10n/zh_HK.js | 2 | ||||
-rw-r--r-- | lib/l10n/zh_HK.json | 2 | ||||
-rw-r--r-- | lib/private/AppFramework/Bootstrap/Coordinator.php | 1 | ||||
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 25 | ||||
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 11 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/S3ConnectionTrait.php | 30 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 13 | ||||
-rw-r--r-- | lib/private/Files/Template/TemplateManager.php | 2 | ||||
-rw-r--r-- | lib/private/Preview/Imaginary.php | 2 | ||||
-rw-r--r-- | lib/public/Dashboard/RegisterWidgetEvent.php | 4 | ||||
-rw-r--r-- | lib/public/Files/Storage.php | 4 | ||||
-rw-r--r-- | lib/public/Group/Backend/ABackend.php | 1 | ||||
-rw-r--r-- | lib/public/User/Backend/ABackend.php | 1 |
18 files changed, 119 insertions, 48 deletions
diff --git a/lib/composer/composer/ClassLoader.php b/lib/composer/composer/ClassLoader.php index afef3fa2ad8..fd56bd7d840 100644 --- a/lib/composer/composer/ClassLoader.php +++ b/lib/composer/composer/ClassLoader.php @@ -42,6 +42,9 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + /** @var ?string */ private $vendorDir; @@ -106,6 +109,7 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** @@ -425,7 +429,7 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + (self::$includeFile)($file); return true; } @@ -555,18 +559,23 @@ class ClassLoader return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + private static function initializeIncludeClosure(): void + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = static function($file) { + include $file; + }; + } } diff --git a/lib/composer/composer/autoload_real.php b/lib/composer/composer/autoload_real.php index 6dbf91afee6..9e054bba0be 100644 --- a/lib/composer/composer/autoload_real.php +++ b/lib/composer/composer/autoload_real.php @@ -22,6 +22,8 @@ class ComposerAutoloaderInit749170dad3f5e7f9ca158f5a9f04f6a2 return self::$loader; } + require __DIR__ . '/platform_check.php'; + spl_autoload_register(array('ComposerAutoloaderInit749170dad3f5e7f9ca158f5a9f04f6a2', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit749170dad3f5e7f9ca158f5a9f04f6a2', 'loadClassLoader')); diff --git a/lib/composer/composer/platform_check.php b/lib/composer/composer/platform_check.php new file mode 100644 index 00000000000..adfb472fbdd --- /dev/null +++ b/lib/composer/composer/platform_check.php @@ -0,0 +1,26 @@ +<?php + +// platform_check.php @generated by Composer + +$issues = array(); + +if (!(PHP_VERSION_ID >= 80000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/lib/l10n/th.js b/lib/l10n/th.js index cd1292293a6..9269824891c 100644 --- a/lib/l10n/th.js +++ b/lib/l10n/th.js @@ -67,7 +67,7 @@ OC.L10N.register( "You are not allowed to share %s" : "คุณไม่ได้รับอนุญาตให้แชร์ %s", "Cannot increase permissions of %s" : "ไม่สามารถเพิ่มสิทธิ์ของ %s", "Expiration date is in the past" : "วันหมดอายุอยู่ในอดีต", - "Sharing %s failed, because this item is already shared with user %s" : "%s ที่กำลังแชร์ล้มเหลว เพราะรายการนี้ได้ถูกแชร์กับผู้ใช้ %s", + "Sharing %s failed, because this item is already shared with user %s" : "การแชร์ %s ล้มเหลว เพราะรายการนี้ได้แชร์กับผู้ใช้ %s ไปแล้ว", "Could not find category \"%s\"" : "ไม่สามารถหาหมวดหมู่ \"%s\"", "Sunday" : "วันอาทิตย์", "Monday" : "วันจันทร์", diff --git a/lib/l10n/th.json b/lib/l10n/th.json index 1dcd16b4f5f..91ad89fae41 100644 --- a/lib/l10n/th.json +++ b/lib/l10n/th.json @@ -65,7 +65,7 @@ "You are not allowed to share %s" : "คุณไม่ได้รับอนุญาตให้แชร์ %s", "Cannot increase permissions of %s" : "ไม่สามารถเพิ่มสิทธิ์ของ %s", "Expiration date is in the past" : "วันหมดอายุอยู่ในอดีต", - "Sharing %s failed, because this item is already shared with user %s" : "%s ที่กำลังแชร์ล้มเหลว เพราะรายการนี้ได้ถูกแชร์กับผู้ใช้ %s", + "Sharing %s failed, because this item is already shared with user %s" : "การแชร์ %s ล้มเหลว เพราะรายการนี้ได้แชร์กับผู้ใช้ %s ไปแล้ว", "Could not find category \"%s\"" : "ไม่สามารถหาหมวดหมู่ \"%s\"", "Sunday" : "วันอาทิตย์", "Monday" : "วันจันทร์", diff --git a/lib/l10n/zh_HK.js b/lib/l10n/zh_HK.js index 1c23c817e5a..bb56ed61457 100644 --- a/lib/l10n/zh_HK.js +++ b/lib/l10n/zh_HK.js @@ -93,7 +93,7 @@ OC.L10N.register( "__language_name__" : "正體中文(香港)", "This is an automatically sent email, please do not reply." : "此為自動寄送的電子郵件,請勿回覆。", "Help" : "說明", - "Appearance and accessibility" : "外觀和可訪問性", + "Appearance and accessibility" : "外觀和可及性", "Apps" : "應用程式", "Personal settings" : "個人設定", "Administration settings" : "管理設定", diff --git a/lib/l10n/zh_HK.json b/lib/l10n/zh_HK.json index 09b83be5966..8d3242cb59c 100644 --- a/lib/l10n/zh_HK.json +++ b/lib/l10n/zh_HK.json @@ -91,7 +91,7 @@ "__language_name__" : "正體中文(香港)", "This is an automatically sent email, please do not reply." : "此為自動寄送的電子郵件,請勿回覆。", "Help" : "說明", - "Appearance and accessibility" : "外觀和可訪問性", + "Appearance and accessibility" : "外觀和可及性", "Apps" : "應用程式", "Personal settings" : "個人設定", "Administration settings" : "管理設定", diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index f5f50b1b775..ff04196fef6 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -153,7 +153,6 @@ class Coordinator { $this->registrationContext->delegateDashboardPanelRegistrations($this->dashboardManager); $this->registrationContext->delegateEventListenerRegistrations($this->eventDispatcher); $this->registrationContext->delegateContainerRegistrations($apps); - $this->registrationContext->delegateMiddlewareRegistrations($apps); } public function getRegistrationContext(): ?RegistrationContext { diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 04faf330dc3..ac3f42ff2af 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -617,29 +617,10 @@ class RegistrationContext { } /** - * @param App[] $apps + * @return ServiceRegistration<Middleware>[] */ - public function delegateMiddlewareRegistrations(array $apps): void { - while (($middleware = array_shift($this->middlewares)) !== null) { - $appId = $middleware->getAppId(); - if (!isset($apps[$appId])) { - // If we land here something really isn't right. But at least we caught the - // notice that is otherwise emitted for the undefined index - $this->logger->error("App $appId not loaded for the container middleware registration"); - - continue; - } - - try { - $apps[$appId] - ->getContainer() - ->registerMiddleWare($middleware->getService()); - } catch (Throwable $e) { - $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [ - 'exception' => $e, - ]); - } - } + public function getMiddlewareRegistrations(): array { + return $this->middlewares; } /** diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 6e0e452bccd..6e7f054a80b 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -315,6 +315,17 @@ class DIContainer extends SimpleContainer implements IAppContainer { $c->get(\OC\AppFramework\Middleware\AdditionalScriptsMiddleware::class) ); + /** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */ + $coordinator = $c->get(\OC\AppFramework\Bootstrap\Coordinator::class); + $registrationContext = $coordinator->getRegistrationContext(); + if ($registrationContext !== null) { + $appId = $this->getAppName(); + foreach ($registrationContext->getMiddlewareRegistrations() as $middlewareRegistration) { + if ($middlewareRegistration->getAppId() === $appId) { + $dispatcher->registerMiddleware($c->get($middlewareRegistration->getService())); + } + } + } foreach ($this->middleWares as $middleWare) { $dispatcher->registerMiddleware($c->get($middleWare)); } diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 09fdffe01bd..deb03571c76 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -231,4 +231,34 @@ trait S3ConnectionTrait { return null; } } + + protected function getSSECKey(): ?string { + if (isset($this->params['sse_c_key'])) { + return $this->params['sse_c_key']; + } + + return null; + } + + protected function getSSECParameters(bool $copy = false): array { + $key = $this->getSSECKey(); + + if ($key === null) { + return []; + } + + $rawKey = base64_decode($key); + if ($copy) { + return [ + 'CopySourceSSECustomerAlgorithm' => 'AES256', + 'CopySourceSSECustomerKey' => $rawKey, + 'CopySourceSSECustomerKeyMD5' => md5($rawKey, true) + ]; + } + return [ + 'SSECustomerAlgorithm' => 'AES256', + 'SSECustomerKey' => $rawKey, + 'SSECustomerKeyMD5' => md5($rawKey, true) + ]; + } } diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 33b9f6f7fed..8fa6d67faa3 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -44,6 +44,7 @@ trait S3ObjectTrait { abstract protected function getConnection(); abstract protected function getCertificateBundlePath(): ?string; + abstract protected function getSSECParameters(bool $copy = false): array; /** * @param string $urn the unified resource name used to identify the object @@ -58,7 +59,7 @@ trait S3ObjectTrait { 'Bucket' => $this->bucket, 'Key' => $urn, 'Range' => 'bytes=' . $range, - ]); + ] + $this->getSSECParameters()); $request = \Aws\serialize($command); $headers = []; foreach ($request->getHeaders() as $key => $values) { @@ -106,7 +107,7 @@ trait S3ObjectTrait { 'ACL' => 'private', 'ContentType' => $mimetype, 'StorageClass' => $this->storageClass, - ]); + ] + $this->getSSECParameters()); } @@ -126,7 +127,7 @@ trait S3ObjectTrait { 'params' => [ 'ContentType' => $mimetype, 'StorageClass' => $this->storageClass, - ], + ] + $this->getSSECParameters(), ]); try { @@ -181,10 +182,12 @@ trait S3ObjectTrait { } public function objectExists($urn) { - return $this->getConnection()->doesObjectExist($this->bucket, $urn); + return $this->getConnection()->doesObjectExist($this->bucket, $urn, $this->getSSECParameters()); } public function copyObject($from, $to) { - $this->getConnection()->copy($this->getBucket(), $from, $this->getBucket(), $to); + $this->getConnection()->copy($this->getBucket(), $from, $this->getBucket(), $to, 'private', [ + 'params' => $this->getSSECParameters() + $this->getSSECParameters(true) + ]); } } diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index dde224e5ead..4603c14278f 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -277,7 +277,7 @@ class TemplateManager implements ITemplateManager { try { $l10n = $this->l10nFactory->get('lib', $userLang); $userFolder = $this->rootFolder->getUserFolder($this->userId); - $userTemplatePath = $path ?? $l10n->t('Templates') . '/'; + $userTemplatePath = $path ?? $this->config->getAppValue('core', 'defaultTemplateDirectory', $l10n->t('Templates')) . '/'; // Initial user setup without a provided path if ($path === null) { diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index e78b9b441f6..0d75dbd7069 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -57,7 +57,7 @@ class Imaginary extends ProviderV2 { } public static function supportedMimeTypes(): string { - return '/image\/(bmp|x-bitmap|png|jpeg|gif|heic|svg|webp)/'; + return '/image\/(bmp|x-bitmap|png|jpeg|gif|heic|svg|tiff|webp)/'; } public function getCroppedThumbnail(File $file, int $maxX, int $maxY, bool $crop): ?IImage { diff --git a/lib/public/Dashboard/RegisterWidgetEvent.php b/lib/public/Dashboard/RegisterWidgetEvent.php index 289de8e965d..f0bf049571a 100644 --- a/lib/public/Dashboard/RegisterWidgetEvent.php +++ b/lib/public/Dashboard/RegisterWidgetEvent.php @@ -41,6 +41,10 @@ use OCP\EventDispatcher\Event; class RegisterWidgetEvent extends Event { private $manager; + /** + * @param IManager $manager + * @since 20.0.0 + */ public function __construct(IManager $manager) { parent::__construct(); diff --git a/lib/public/Files/Storage.php b/lib/public/Files/Storage.php index f3812396c5b..a0acb4508d2 100644 --- a/lib/public/Files/Storage.php +++ b/lib/public/Files/Storage.php @@ -462,5 +462,9 @@ interface Storage extends IStorage { */ public function setAvailability($isAvailable); + /** + * @since 12.0.0 + * @return mixed + */ public function needsPartFile(); } diff --git a/lib/public/Group/Backend/ABackend.php b/lib/public/Group/Backend/ABackend.php index e5b7f78ac6a..7f5cf732335 100644 --- a/lib/public/Group/Backend/ABackend.php +++ b/lib/public/Group/Backend/ABackend.php @@ -33,6 +33,7 @@ use OCP\GroupInterface; abstract class ABackend implements GroupInterface { /** * @deprecated 14.0.0 + * @since 14.0.0 * * @param int $actions The action to check for * @return bool diff --git a/lib/public/User/Backend/ABackend.php b/lib/public/User/Backend/ABackend.php index 2b246dc0acf..417b14cfb36 100644 --- a/lib/public/User/Backend/ABackend.php +++ b/lib/public/User/Backend/ABackend.php @@ -36,6 +36,7 @@ use OCP\UserInterface; abstract class ABackend implements IUserBackend, UserInterface { /** * @deprecated 14.0.0 + * @since 14.0.0 * * @param int $actions The action to check for * @return bool |