diff options
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 | 4 | ||||
-rw-r--r-- | lib/l10n/es.json | 4 | ||||
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 11 | ||||
-rw-r--r-- | lib/private/AppConfig.php | 3 | ||||
-rw-r--r-- | lib/private/Contacts/ContactsMenu/ContactsStore.php | 13 | ||||
-rw-r--r-- | lib/private/Dashboard/Manager.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 9 | ||||
-rw-r--r-- | lib/private/RichObjectStrings/Validator.php | 2 | ||||
-rw-r--r-- | lib/private/SystemConfig.php | 1 | ||||
-rw-r--r-- | lib/private/User/Session.php | 7 | ||||
-rw-r--r-- | lib/public/SetupCheck/SetupResult.php | 40 |
13 files changed, 69 insertions, 29 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 78a101dcdf6..72e90f09377 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1017,6 +1017,7 @@ return array( 'OC\\Core\\Command\\Background\\Ajax' => $baseDir . '/core/Command/Background/Ajax.php', 'OC\\Core\\Command\\Background\\Base' => $baseDir . '/core/Command/Background/Base.php', 'OC\\Core\\Command\\Background\\Cron' => $baseDir . '/core/Command/Background/Cron.php', + 'OC\\Core\\Command\\Background\\Delete' => $baseDir . '/core/Command/Background/Delete.php', 'OC\\Core\\Command\\Background\\Job' => $baseDir . '/core/Command/Background/Job.php', 'OC\\Core\\Command\\Background\\ListCommand' => $baseDir . '/core/Command/Background/ListCommand.php', 'OC\\Core\\Command\\Background\\WebCron' => $baseDir . '/core/Command/Background/WebCron.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 2026dfec112..485d6417e1f 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1050,6 +1050,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Core\\Command\\Background\\Ajax' => __DIR__ . '/../../..' . '/core/Command/Background/Ajax.php', 'OC\\Core\\Command\\Background\\Base' => __DIR__ . '/../../..' . '/core/Command/Background/Base.php', 'OC\\Core\\Command\\Background\\Cron' => __DIR__ . '/../../..' . '/core/Command/Background/Cron.php', + 'OC\\Core\\Command\\Background\\Delete' => __DIR__ . '/../../..' . '/core/Command/Background/Delete.php', 'OC\\Core\\Command\\Background\\Job' => __DIR__ . '/../../..' . '/core/Command/Background/Job.php', 'OC\\Core\\Command\\Background\\ListCommand' => __DIR__ . '/../../..' . '/core/Command/Background/ListCommand.php', 'OC\\Core\\Command\\Background\\WebCron' => __DIR__ . '/../../..' . '/core/Command/Background/WebCron.php', diff --git a/lib/l10n/es.js b/lib/l10n/es.js index 4db9814b89f..237fb7df4de 100644 --- a/lib/l10n/es.js +++ b/lib/l10n/es.js @@ -237,7 +237,7 @@ OC.L10N.register( "PHP setting \"%s\" is not set to \"%s\"." : "La opción PHP \"%s\" no es \"%s\".", "Adjusting this setting in php.ini will make Nextcloud run again" : "Ajustar esta configuración en php.ini hará que Nextcloud funcione de nuevo", "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está establecida como <code>%s</code> en lugar del valor esperado: <code>0</code>.", - "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para arreglar este problema, establece <code>mbstring.func_overload</code> en<code>0</code> en tu php.ini.", + "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para arreglar este problema, establezca <code>mbstring.func_overload</code> en<code>0</code> en su php.ini.", "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP está aparentemente configurado para eliminar bloques de documentos en línea. Esto hará que varias aplicaciones principales estén inaccesibles.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Probablemente esto venga a causa de la caché o un acelerador, tales como Zend OPcache o eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Los módulos PHP se han instalado, pero aparecen listados como si faltaran", @@ -273,7 +273,7 @@ OC.L10N.register( "404" : "404", "Full name" : "Nombre completo", "libxml2 2.7.0 is at least required. Currently %s is installed." : "libxml2 2.7.0 es requerido en esta o en versiones superiores. Ahora mismo tienes instalada %s.", - "To fix this issue update your libxml2 version and restart your web server." : "Para corregir este error, actualiza la versión de tu libxml2 y reinicia el servidor web.", + "To fix this issue update your libxml2 version and restart your web server." : "Para corregir este problema, actualice su versión de libxml2 y reinicie el servidor web.", "PostgreSQL >= 9 required." : "PostgreSQL >= 9 requerido.", "Please upgrade your database version." : "Por favor, actualiza la versión de tu base de datos." }, diff --git a/lib/l10n/es.json b/lib/l10n/es.json index 66d7b7128fb..26023daed56 100644 --- a/lib/l10n/es.json +++ b/lib/l10n/es.json @@ -235,7 +235,7 @@ "PHP setting \"%s\" is not set to \"%s\"." : "La opción PHP \"%s\" no es \"%s\".", "Adjusting this setting in php.ini will make Nextcloud run again" : "Ajustar esta configuración en php.ini hará que Nextcloud funcione de nuevo", "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está establecida como <code>%s</code> en lugar del valor esperado: <code>0</code>.", - "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para arreglar este problema, establece <code>mbstring.func_overload</code> en<code>0</code> en tu php.ini.", + "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para arreglar este problema, establezca <code>mbstring.func_overload</code> en<code>0</code> en su php.ini.", "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP está aparentemente configurado para eliminar bloques de documentos en línea. Esto hará que varias aplicaciones principales estén inaccesibles.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Probablemente esto venga a causa de la caché o un acelerador, tales como Zend OPcache o eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Los módulos PHP se han instalado, pero aparecen listados como si faltaran", @@ -271,7 +271,7 @@ "404" : "404", "Full name" : "Nombre completo", "libxml2 2.7.0 is at least required. Currently %s is installed." : "libxml2 2.7.0 es requerido en esta o en versiones superiores. Ahora mismo tienes instalada %s.", - "To fix this issue update your libxml2 version and restart your web server." : "Para corregir este error, actualiza la versión de tu libxml2 y reinicia el servidor web.", + "To fix this issue update your libxml2 version and restart your web server." : "Para corregir este problema, actualice su versión de libxml2 y reinicie el servidor web.", "PostgreSQL >= 9 required." : "PostgreSQL >= 9 requerido.", "Please upgrade your database version." : "Por favor, actualiza la versión de tu base de datos." },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index 3e76ab2d5da..a693804f50f 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -109,10 +109,13 @@ abstract class Fetcher { ]; } - // If we have a valid subscription key, send it to the appstore - $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); - if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) { - $options['headers']['X-NC-Subscription-Key'] = $subscriptionKey; + if ($this->config->getSystemValueString('appstoreurl', 'https://apps.nextcloud.com/api/v1') === 'https://apps.nextcloud.com/api/v1') { + // If we have a valid subscription key, send it to the appstore + $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); + if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) { + $options['headers'] ??= []; + $options['headers']['X-NC-Subscription-Key'] = $subscriptionKey; + } } $client = $this->clientService->newClient(); diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 79c650705b2..f92abb2caad 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -109,6 +109,9 @@ class AppConfig implements IAppConfig { 'notify_push' => [ '/^cookie$/', ], + 'serverinfo' => [ + '/^token$/', + ], 'spreed' => [ '/^bridge_bot_password$/', '/^hosted-signaling-server-(.*)$/', diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index eeb6ae56bc1..25a90e5f0f7 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -334,14 +334,15 @@ class ContactsStore implements IContactsStore { private function contactArrayToEntry(array $contact): Entry { $entry = new Entry(); - if (isset($contact['UID'])) { + if (!empty($contact['UID'])) { $uid = $contact['UID']; $entry->setId($uid); $entry->setProperty('isUser', false); + // overloaded usage so leaving as-is for now if (isset($contact['isLocalSystemBook'])) { $avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]); $entry->setProperty('isUser', true); - } elseif (isset($contact['FN'])) { + } elseif (!empty($contact['FN'])) { $avatar = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => $contact['FN'], 'size' => 64]); } else { $avatar = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => $uid, 'size' => 64]); @@ -349,23 +350,23 @@ class ContactsStore implements IContactsStore { $entry->setAvatar($avatar); } - if (isset($contact['FN'])) { + if (!empty($contact['FN'])) { $entry->setFullName($contact['FN']); } $avatarPrefix = "VALUE=uri:"; - if (isset($contact['PHOTO']) && str_starts_with($contact['PHOTO'], $avatarPrefix)) { + if (!empty($contact['PHOTO']) && str_starts_with($contact['PHOTO'], $avatarPrefix)) { $entry->setAvatar(substr($contact['PHOTO'], strlen($avatarPrefix))); } - if (isset($contact['EMAIL'])) { + if (!empty($contact['EMAIL'])) { foreach ($contact['EMAIL'] as $email) { $entry->addEMailAddress($email); } } // Provide profile parameters for core/src/OC/contactsmenu/contact.handlebars template - if (isset($contact['UID']) && isset($contact['FN'])) { + if (!empty($contact['UID']) && !empty($contact['FN'])) { $targetUserId = $contact['UID']; $targetUser = $this->userManager->get($targetUserId); if (!empty($targetUser)) { diff --git a/lib/private/Dashboard/Manager.php b/lib/private/Dashboard/Manager.php index 5a7e4f3c6dc..25a2df5d9da 100644 --- a/lib/private/Dashboard/Manager.php +++ b/lib/private/Dashboard/Manager.php @@ -115,7 +115,7 @@ class Manager implements IManager { $endTime = microtime(true); $duration = $endTime - $startTime; if ($duration > 1) { - \OC::$server->get(LoggerInterface::class)->error( + \OC::$server->get(LoggerInterface::class)->info( 'Dashboard widget {widget} took {duration} seconds to load.', [ 'widget' => $widget->getId(), diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index c09087b43ae..052b3c75ce8 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -606,9 +606,12 @@ class Cache implements ICache { } /** @var ICacheEntry[] $childFolders */ - $childFolders = array_filter($children, function ($child) { - return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER; - }); + $childFolders = []; + foreach ($children as $child) { + if ($child->getMimeType() == FileInfo::MIMETYPE_FOLDER) { + $childFolders[] = $child; + } + } foreach ($childFolders as $folder) { $parentIds[] = $folder->getId(); $queue[] = $folder->getId(); diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php index 4585cbfc814..d7329c945e9 100644 --- a/lib/private/RichObjectStrings/Validator.php +++ b/lib/private/RichObjectStrings/Validator.php @@ -95,7 +95,7 @@ class Validator implements IValidator { $missingKeys = array_diff($requiredParameters, array_keys($parameter)); if (!empty($missingKeys)) { - throw new InvalidObjectExeption('Object is invalid'); + throw new InvalidObjectExeption('Object is invalid, missing keys:'.json_encode($missingKeys)); } } diff --git a/lib/private/SystemConfig.php b/lib/private/SystemConfig.php index c104f001809..bba74e96490 100644 --- a/lib/private/SystemConfig.php +++ b/lib/private/SystemConfig.php @@ -55,6 +55,7 @@ class SystemConfig { 'secret' => true, 'updater.secret' => true, 'trusted_proxies' => true, + 'preview_imaginary_url' => true, 'proxyuserpwd' => true, 'sentry.dsn' => true, 'sentry.public-dsn' => true, diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 02a7a7e9e16..772a4103490 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -842,13 +842,16 @@ class Session implements IUserSession, Emitter { $authHeader = $request->getHeader('Authorization'); if (str_starts_with($authHeader, 'Bearer ')) { $token = substr($authHeader, 7); - } else { - // No auth header, let's try session id + } elseif ($request->getCookie($this->config->getSystemValueString('instanceid')) !== null) { + // No auth header, let's try session id, but only if this is an existing + // session and the request has a session cookie try { $token = $this->session->getId(); } catch (SessionNotAvailableException $ex) { return false; } + } else { + return false; } if (!$this->loginWithToken($token)) { diff --git a/lib/public/SetupCheck/SetupResult.php b/lib/public/SetupCheck/SetupResult.php index e4a7744178a..835cbe8b4a2 100644 --- a/lib/public/SetupCheck/SetupResult.php +++ b/lib/public/SetupCheck/SetupResult.php @@ -26,6 +26,8 @@ declare(strict_types=1); namespace OCP\SetupCheck; +use OCP\RichObjectStrings\IValidator; + /** * @brief This class is used for storing the result of a setup check * @@ -46,12 +48,18 @@ class SetupResult implements \JsonSerializable { * @brief Private constructor, use success()/info()/warning()/error() instead * @param self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity * @since 28.0.0 + * @since 28.0.2 Optional parameter ?array $descriptionParameters + * @since 28.0.2 throws \OCP\RichObjectStrings\InvalidObjectExeption */ private function __construct( private string $severity, private ?string $description = null, + private ?array $descriptionParameters = null, private ?string $linkToDoc = null, ) { + if ($description !== null && $descriptionParameters !== null) { + \OCP\Server::get(IValidator::class)->validate($description, $descriptionParameters); + } } /** @@ -59,9 +67,10 @@ class SetupResult implements \JsonSerializable { * @param ?string $description Translated detailed description to display to the user * @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project * @since 28.0.0 + * @since 28.0.2 Optional parameter ?array $descriptionParameters */ - public static function success(?string $description = null, ?string $linkToDoc = null): self { - return new self(self::SUCCESS, $description, $linkToDoc); + public static function success(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self { + return new self(self::SUCCESS, $description, $descriptionParameters, $linkToDoc); } /** @@ -69,9 +78,10 @@ class SetupResult implements \JsonSerializable { * @param ?string $description Translated detailed description to display to the user * @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project * @since 28.0.0 + * @since 28.0.2 Optional parameter ?array $descriptionParameters */ - public static function info(?string $description = null, ?string $linkToDoc = null): self { - return new self(self::INFO, $description, $linkToDoc); + public static function info(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self { + return new self(self::INFO, $description, $descriptionParameters, $linkToDoc); } /** @@ -79,9 +89,10 @@ class SetupResult implements \JsonSerializable { * @param ?string $description Translated detailed description to display to the user * @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project * @since 28.0.0 + * @since 28.0.2 Optional parameter ?array $descriptionParameters */ - public static function warning(?string $description = null, ?string $linkToDoc = null): self { - return new self(self::WARNING, $description, $linkToDoc); + public static function warning(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self { + return new self(self::WARNING, $description, $descriptionParameters, $linkToDoc); } /** @@ -89,9 +100,10 @@ class SetupResult implements \JsonSerializable { * @param ?string $description Translated detailed description to display to the user * @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project * @since 28.0.0 + * @since 28.0.2 Optional parameter ?array $descriptionParameters */ - public static function error(?string $description = null, ?string $linkToDoc = null): self { - return new self(self::ERROR, $description, $linkToDoc); + public static function error(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self { + return new self(self::ERROR, $description, $descriptionParameters, $linkToDoc); } /** @@ -114,6 +126,17 @@ class SetupResult implements \JsonSerializable { } /** + * @brief Get the description parameters for the setup check result + * + * If this returns null, description must not be treated as rich text + * + * @since 28.0.2 + */ + public function getDescriptionParameters(): ?array { + return $this->descriptionParameters; + } + + /** * @brief Get the name for the setup check * * @since 28.0.0 @@ -150,6 +173,7 @@ class SetupResult implements \JsonSerializable { 'name' => $this->name, 'severity' => $this->severity, 'description' => $this->description, + 'descriptionParameters' => $this->descriptionParameters, 'linkToDoc' => $this->linkToDoc, ]; } |