diff options
Diffstat (limited to 'lib')
41 files changed, 232 insertions, 131 deletions
diff --git a/lib/composer/composer/ClassLoader.php b/lib/composer/composer/ClassLoader.php index 0cd6055d1b7..afef3fa2ad8 100644 --- a/lib/composer/composer/ClassLoader.php +++ b/lib/composer/composer/ClassLoader.php @@ -149,7 +149,7 @@ class ClassLoader /** * @return string[] Array of classname => path - * @psalm-var array<string, string> + * @psalm-return array<string, string> */ public function getClassMap() { diff --git a/lib/composer/composer/InstalledVersions.php b/lib/composer/composer/InstalledVersions.php index b3a4e1611e6..d50e0c9fcc4 100644 --- a/lib/composer/composer/InstalledVersions.php +++ b/lib/composer/composer/InstalledVersions.php @@ -20,12 +20,25 @@ use Composer\Semver\VersionParser; * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * To require its presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + */ private static $installedByVendor = array(); /** @@ -228,7 +241,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -242,7 +255,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} */ public static function getRawData() { @@ -265,7 +278,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> */ public static function getAllRawData() { @@ -288,7 +301,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data */ public static function reload($data) { @@ -298,7 +311,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> */ private static function getInstalled() { diff --git a/lib/composer/composer/installed.php b/lib/composer/composer/installed.php index b811738fbd0..f12a8e00dbe 100644 --- a/lib/composer/composer/installed.php +++ b/lib/composer/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => '66144c300395458ff38b86e50cd92174443cd85e', + 'reference' => '1225189f74d06606aafc4150d07584b90cea50dd', 'name' => '__root__', 'dev' => false, ), @@ -16,7 +16,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => '66144c300395458ff38b86e50cd92174443cd85e', + 'reference' => '1225189f74d06606aafc4150d07584b90cea50dd', 'dev_requirement' => false, ), ), diff --git a/lib/l10n/de_DE.js b/lib/l10n/de_DE.js index 0b7b1bea92c..25816d7dd9a 100644 --- a/lib/l10n/de_DE.js +++ b/lib/l10n/de_DE.js @@ -212,17 +212,17 @@ OC.L10N.register( "Authentication error" : "Authentifizierungsfehler", "Token expired. Please reload page." : "Token abgelaufen. Bitte laden Sie die Seite neu.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Keine Datenbanktreiber (SQLite, MySQL oder PostgreSQL) installiert.", - "Cannot write into \"config\" directory." : "Schreiben in das „config“-Verzeichnis ist nicht möglich.", + "Cannot write into \"config\" directory." : "Es kann nicht in das Verzeichnis \"config\" geschrieben werden.", "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Dies kann zumeist behoben werden, indem dem Webserver Schreibzugriff auf das Konfigurationsverzeichnis eingeräumt wird. Siehe auch %s", "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Oder wenn Sie möchten, dass die Datei config.php schreibgeschützt bleiben soll, dann setzen Sie die Option \"config_is_read_only\" in der Datei auf True. Siehe %s", "Cannot write into \"apps\" directory." : "Es kann nicht in das Verzeichnis \"apps\" geschrieben werden.", "This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file." : "Dies kann normalerweise behoben werden, indem dem Webserver Schreibzugriff auf das App-Verzeichnis gegeben wird oder der App-Store in der Konfigurationsdatei deaktiviert wird.", "Cannot create \"data\" directory." : "Kann das \"Daten\"-Verzeichnis nicht erstellen.", - "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Dies kann zumeist behoben werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s", - "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Berechtigungen können zumeist korrigiert werden indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s. ", + "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Dies kann normalerweise behoben werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s", + "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Berechtigungen können normalerweise korrigiert werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s. ", "Your data directory is not writable." : "Ihr Datenverzeichnis ist schreibgeschützt.", - "Setting locale to %s failed." : "Das Setzen der Umgebungslokale auf %s ist fehlgeschlagen.", - "Please install one of these locales on your system and restart your web server." : "Bitte installieren Sie eine dieser Sprachen auf Ihrem System und starten Sie den Webserver neu.", + "Setting locale to %s failed." : "Das Setzen der Sprache (locale) auf %s ist fehlgeschlagen.", + "Please install one of these locales on your system and restart your web server." : "Bitte installieren Sie eine dieser Sprachen (locales) auf Ihrem System und starten Sie den Webserver neu.", "PHP module %s not installed." : "PHP-Modul %s nicht installiert.", "Please ask your server administrator to install the module." : "Bitte kontaktieren Sie Ihren Server-Administrator und bitten Sie um die Installation des Moduls.", "PHP setting \"%s\" is not set to \"%s\"." : "PHP-Einstellung „%s“ ist nicht auf „%s“ gesetzt.", @@ -239,8 +239,8 @@ OC.L10N.register( "Please upgrade your database version." : "Bitte aktualisieren Sie Ihre Datenbankversion.", "Your data directory is readable by other users." : "Ihr Datenverzeichnis kann von anderen Benutzern gelesen werden.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Bitte ändern Sie die Berechtigungen auf 0770, so dass das Verzeichnis nicht von anderen Benutzern angezeigt werden kann.", - "Your data directory must be an absolute path." : "Ihr Datenverzeichnis muss einen eindeutigen Pfad haben.", - "Check the value of \"datadirectory\" in your configuration." : "Überprüfen Sie bitte die Angabe unter „datadirectory“ in Ihrer Konfiguration.", + "Your data directory must be an absolute path." : "Ihr Datenverzeichnis muss einen absoluten Pfad haben.", + "Check the value of \"datadirectory\" in your configuration." : "Überprüfen Sie den Wert von „datadirectory“ in Ihrer Konfiguration.", "Your data directory is invalid." : "Ihr Datenverzeichnis ist ungültig.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Stellen Sie sicher, dass eine Datei \".ocdata\" im Wurzelverzeichnis des Datenverzeichnisses existiert.", "Action \"%s\" not supported or implemented." : "Aktion \"%s\" wird nicht unterstützt oder ist nicht implementiert.", diff --git a/lib/l10n/de_DE.json b/lib/l10n/de_DE.json index aae87c3d91f..92bb4dc825f 100644 --- a/lib/l10n/de_DE.json +++ b/lib/l10n/de_DE.json @@ -210,17 +210,17 @@ "Authentication error" : "Authentifizierungsfehler", "Token expired. Please reload page." : "Token abgelaufen. Bitte laden Sie die Seite neu.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Keine Datenbanktreiber (SQLite, MySQL oder PostgreSQL) installiert.", - "Cannot write into \"config\" directory." : "Schreiben in das „config“-Verzeichnis ist nicht möglich.", + "Cannot write into \"config\" directory." : "Es kann nicht in das Verzeichnis \"config\" geschrieben werden.", "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Dies kann zumeist behoben werden, indem dem Webserver Schreibzugriff auf das Konfigurationsverzeichnis eingeräumt wird. Siehe auch %s", "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Oder wenn Sie möchten, dass die Datei config.php schreibgeschützt bleiben soll, dann setzen Sie die Option \"config_is_read_only\" in der Datei auf True. Siehe %s", "Cannot write into \"apps\" directory." : "Es kann nicht in das Verzeichnis \"apps\" geschrieben werden.", "This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file." : "Dies kann normalerweise behoben werden, indem dem Webserver Schreibzugriff auf das App-Verzeichnis gegeben wird oder der App-Store in der Konfigurationsdatei deaktiviert wird.", "Cannot create \"data\" directory." : "Kann das \"Daten\"-Verzeichnis nicht erstellen.", - "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Dies kann zumeist behoben werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s", - "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Berechtigungen können zumeist korrigiert werden indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s. ", + "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Dies kann normalerweise behoben werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s", + "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Berechtigungen können normalerweise korrigiert werden, indem dem Webserver Schreibzugriff auf das Wurzel-Verzeichnis eingeräumt wird. Siehe auch %s. ", "Your data directory is not writable." : "Ihr Datenverzeichnis ist schreibgeschützt.", - "Setting locale to %s failed." : "Das Setzen der Umgebungslokale auf %s ist fehlgeschlagen.", - "Please install one of these locales on your system and restart your web server." : "Bitte installieren Sie eine dieser Sprachen auf Ihrem System und starten Sie den Webserver neu.", + "Setting locale to %s failed." : "Das Setzen der Sprache (locale) auf %s ist fehlgeschlagen.", + "Please install one of these locales on your system and restart your web server." : "Bitte installieren Sie eine dieser Sprachen (locales) auf Ihrem System und starten Sie den Webserver neu.", "PHP module %s not installed." : "PHP-Modul %s nicht installiert.", "Please ask your server administrator to install the module." : "Bitte kontaktieren Sie Ihren Server-Administrator und bitten Sie um die Installation des Moduls.", "PHP setting \"%s\" is not set to \"%s\"." : "PHP-Einstellung „%s“ ist nicht auf „%s“ gesetzt.", @@ -237,8 +237,8 @@ "Please upgrade your database version." : "Bitte aktualisieren Sie Ihre Datenbankversion.", "Your data directory is readable by other users." : "Ihr Datenverzeichnis kann von anderen Benutzern gelesen werden.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Bitte ändern Sie die Berechtigungen auf 0770, so dass das Verzeichnis nicht von anderen Benutzern angezeigt werden kann.", - "Your data directory must be an absolute path." : "Ihr Datenverzeichnis muss einen eindeutigen Pfad haben.", - "Check the value of \"datadirectory\" in your configuration." : "Überprüfen Sie bitte die Angabe unter „datadirectory“ in Ihrer Konfiguration.", + "Your data directory must be an absolute path." : "Ihr Datenverzeichnis muss einen absoluten Pfad haben.", + "Check the value of \"datadirectory\" in your configuration." : "Überprüfen Sie den Wert von „datadirectory“ in Ihrer Konfiguration.", "Your data directory is invalid." : "Ihr Datenverzeichnis ist ungültig.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Stellen Sie sicher, dass eine Datei \".ocdata\" im Wurzelverzeichnis des Datenverzeichnisses existiert.", "Action \"%s\" not supported or implemented." : "Aktion \"%s\" wird nicht unterstützt oder ist nicht implementiert.", diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js index eca7f7b0be5..ae7454798ab 100644 --- a/lib/l10n/fr.js +++ b/lib/l10n/fr.js @@ -222,6 +222,7 @@ OC.L10N.register( "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "La raison est probablement l'utilisation d'un cache / accélérateur tel que Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Les modules PHP ont été installés mais sont toujours indiqués comme manquants ?", "Please ask your server administrator to restart the web server." : "Veuillez demander à votre administrateur serveur de redémarrer le serveur web.", + "PostgreSQL >= 9 required." : "PostgreSQL >= 9 requis.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Veuillez changer les permissions du répertoire en mode 0770 afin que son contenu ne puisse pas être listé par les autres utilisateurs.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Assurez-vous que le répertoire de données contient un fichier \".ocdata\" à sa racine.", "Action \"%s\" not supported or implemented." : "Action \"%s\" non supportée ou implémentée.", diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json index 53fb4b3478f..68a3ab6d9b2 100644 --- a/lib/l10n/fr.json +++ b/lib/l10n/fr.json @@ -220,6 +220,7 @@ "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "La raison est probablement l'utilisation d'un cache / accélérateur tel que Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Les modules PHP ont été installés mais sont toujours indiqués comme manquants ?", "Please ask your server administrator to restart the web server." : "Veuillez demander à votre administrateur serveur de redémarrer le serveur web.", + "PostgreSQL >= 9 required." : "PostgreSQL >= 9 requis.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Veuillez changer les permissions du répertoire en mode 0770 afin que son contenu ne puisse pas être listé par les autres utilisateurs.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Assurez-vous que le répertoire de données contient un fichier \".ocdata\" à sa racine.", "Action \"%s\" not supported or implemented." : "Action \"%s\" non supportée ou implémentée.", diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js index b57ce95eb4a..26aba19b8ce 100644 --- a/lib/l10n/pt_BR.js +++ b/lib/l10n/pt_BR.js @@ -2,6 +2,7 @@ OC.L10N.register( "lib", { "Cannot write into \"config\" directory!" : "Não é possível gravar no diretório \"config\"!", + "This can usually be fixed by giving the web server write access to the config directory." : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de configuração.", "But, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Mas, se você preferir manter o arquivo config.php somente para leitura, defina a opção \"config_is_read_only\" como true nele. ", "See %s" : "Ver %s", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Os arquivos do aplicativo %1$s não foram instalados corretamente. Certifique-se que é uma versão compatível com seu servidor.", @@ -211,19 +212,36 @@ OC.L10N.register( "Authentication error" : "Erro de autenticação", "Token expired. Please reload page." : "O token expirou. Por favor recarregue a página.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Nenhum driver de banco de dados (sqlite, mysql ou postgresql) instalado.", + "Cannot write into \"config\" directory." : "Não é possível gravar no diretório \"config\".", + "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de configuração. Ver %s", "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Ou, se você preferir manter o arquivo config.php somente para leitura, defina a opção \"config_is_read_only\" como true. Veja %s", + "Cannot write into \"apps\" directory." : "Não é possível gravar no diretório \"apps\".", + "This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file." : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de aplicativos ou desabilitando a App Store no arquivo de configuração.", "Cannot create \"data\" directory." : "Não é possível criar o diretório \"dados\".", + "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório raiz. Ver %s", + "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "As permissões geralmente podem ser corrigidas dando ao servidor web acesso de gravação ao diretório raiz. Ver %s.", + "Your data directory is not writable." : "Seu diretório de dados não é gravável.", + "Setting locale to %s failed." : "Falha ao definir a localidade para %s .", + "Please install one of these locales on your system and restart your web server." : "Instale um dessas localidades em seu sistema e reinicie seu servidor web.", "PHP module %s not installed." : "Módulo PHP %s não instalado.", "Please ask your server administrator to install the module." : "Por favor, peça ao seu administrador do servidor para instalar o módulo.", "PHP setting \"%s\" is not set to \"%s\"." : "Configuração PHP \"%s\" não está configurado para \"%s\".", "Adjusting this setting in php.ini will make Nextcloud run again" : "Ajustar a configuração no php.ini fará com que o Nextcloud execute novamente", + "<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á configurado para <code>%s</code> em vez do valor esperado <code>0</code>.", + "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para corrigir este conjunto de problemas <code>mbstring.func_overload</code> para <code>0</code> no seu php.ini.", "libxml2 2.7.0 is at least required. Currently %s is installed." : "A libxml2 2.7.0 é a versão mínima necessária. Atualmente a versão %s está instalada.", "To fix this issue update your libxml2 version and restart your web server." : "Para corrigir este problema, atualize a versão da sua libxml2 e reinicie seu servidor web.", "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP aparentemente está configurado para retirar blocos doc inline. Isso fará com que vários aplicativos do núcleo fiquem inacessíveis.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Isso provavelmente é causado por um cache/acelerador, como Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Módulos do PHP foram instalados, mas eles ainda estão listados como faltantes?", "Please ask your server administrator to restart the web server." : "Por favor peça ao administrador do servidor para reiniciar o servidor web.", + "PostgreSQL >= 9 required." : "PostgreSQL >= 9 é necessário.", + "Please upgrade your database version." : "Por favor, atualize a versão do seu banco de dados.", + "Your data directory is readable by other users." : "Seu diretório de dados pode ser lido por outros usuários.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Por favor altere as permissões para 0770 para que o diretório não possa ser lido por outros usuários.", + "Your data directory must be an absolute path." : "Seu diretório de dados deve ser um caminho absoluto.", + "Check the value of \"datadirectory\" in your configuration." : "Verifique o valor de \"datadirectory\" em sua configuração.", + "Your data directory is invalid." : "Seu diretório de dados é inválido.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Assegure-se que exista um arquivo chamado \".ocdata\" na raiz do diretório \"data\".", "Action \"%s\" not supported or implemented." : "Ação \"%s\" não suportada ou implementada.", "Authentication failed, wrong token or provider ID given" : "Falha na autenticação, token ou ID do provedor errados", diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json index 53e96d986a7..00fc74041ff 100644 --- a/lib/l10n/pt_BR.json +++ b/lib/l10n/pt_BR.json @@ -1,5 +1,6 @@ { "translations": { "Cannot write into \"config\" directory!" : "Não é possível gravar no diretório \"config\"!", + "This can usually be fixed by giving the web server write access to the config directory." : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de configuração.", "But, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Mas, se você preferir manter o arquivo config.php somente para leitura, defina a opção \"config_is_read_only\" como true nele. ", "See %s" : "Ver %s", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Os arquivos do aplicativo %1$s não foram instalados corretamente. Certifique-se que é uma versão compatível com seu servidor.", @@ -209,19 +210,36 @@ "Authentication error" : "Erro de autenticação", "Token expired. Please reload page." : "O token expirou. Por favor recarregue a página.", "No database drivers (sqlite, mysql, or postgresql) installed." : "Nenhum driver de banco de dados (sqlite, mysql ou postgresql) instalado.", + "Cannot write into \"config\" directory." : "Não é possível gravar no diretório \"config\".", + "This can usually be fixed by giving the web server write access to the config directory. See %s" : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de configuração. Ver %s", "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Ou, se você preferir manter o arquivo config.php somente para leitura, defina a opção \"config_is_read_only\" como true. Veja %s", + "Cannot write into \"apps\" directory." : "Não é possível gravar no diretório \"apps\".", + "This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file." : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório de aplicativos ou desabilitando a App Store no arquivo de configuração.", "Cannot create \"data\" directory." : "Não é possível criar o diretório \"dados\".", + "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Isso geralmente pode ser corrigido dando ao servidor web acesso de gravação ao diretório raiz. Ver %s", + "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "As permissões geralmente podem ser corrigidas dando ao servidor web acesso de gravação ao diretório raiz. Ver %s.", + "Your data directory is not writable." : "Seu diretório de dados não é gravável.", + "Setting locale to %s failed." : "Falha ao definir a localidade para %s .", + "Please install one of these locales on your system and restart your web server." : "Instale um dessas localidades em seu sistema e reinicie seu servidor web.", "PHP module %s not installed." : "Módulo PHP %s não instalado.", "Please ask your server administrator to install the module." : "Por favor, peça ao seu administrador do servidor para instalar o módulo.", "PHP setting \"%s\" is not set to \"%s\"." : "Configuração PHP \"%s\" não está configurado para \"%s\".", "Adjusting this setting in php.ini will make Nextcloud run again" : "Ajustar a configuração no php.ini fará com que o Nextcloud execute novamente", + "<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á configurado para <code>%s</code> em vez do valor esperado <code>0</code>.", + "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para corrigir este conjunto de problemas <code>mbstring.func_overload</code> para <code>0</code> no seu php.ini.", "libxml2 2.7.0 is at least required. Currently %s is installed." : "A libxml2 2.7.0 é a versão mínima necessária. Atualmente a versão %s está instalada.", "To fix this issue update your libxml2 version and restart your web server." : "Para corrigir este problema, atualize a versão da sua libxml2 e reinicie seu servidor web.", "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP aparentemente está configurado para retirar blocos doc inline. Isso fará com que vários aplicativos do núcleo fiquem inacessíveis.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Isso provavelmente é causado por um cache/acelerador, como Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Módulos do PHP foram instalados, mas eles ainda estão listados como faltantes?", "Please ask your server administrator to restart the web server." : "Por favor peça ao administrador do servidor para reiniciar o servidor web.", + "PostgreSQL >= 9 required." : "PostgreSQL >= 9 é necessário.", + "Please upgrade your database version." : "Por favor, atualize a versão do seu banco de dados.", + "Your data directory is readable by other users." : "Seu diretório de dados pode ser lido por outros usuários.", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Por favor altere as permissões para 0770 para que o diretório não possa ser lido por outros usuários.", + "Your data directory must be an absolute path." : "Seu diretório de dados deve ser um caminho absoluto.", + "Check the value of \"datadirectory\" in your configuration." : "Verifique o valor de \"datadirectory\" em sua configuração.", + "Your data directory is invalid." : "Seu diretório de dados é inválido.", "Ensure there is a file called \".ocdata\" in the root of the data directory." : "Assegure-se que exista um arquivo chamado \".ocdata\" na raiz do diretório \"data\".", "Action \"%s\" not supported or implemented." : "Ação \"%s\" não suportada ou implementada.", "Authentication failed, wrong token or provider ID given" : "Falha na autenticação, token ou ID do provedor errados", diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index 78c7995f3a6..c7fdc236de5 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -99,7 +99,7 @@ OC.L10N.register( "Call %s" : "Позвонить %s", "Twitter" : "Твиттер", "View %s on Twitter" : "Посмотреть профиль %s в Твиттере", - "Website" : "Адрес в интернете", + "Website" : "Сайт", "Visit %s" : "Посетить сайт %s", "Address" : "Адрес", "Profile picture" : "Изображение профиля", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index a6af81dd38b..2a0a536377b 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -97,7 +97,7 @@ "Call %s" : "Позвонить %s", "Twitter" : "Твиттер", "View %s on Twitter" : "Посмотреть профиль %s в Твиттере", - "Website" : "Адрес в интернете", + "Website" : "Сайт", "Visit %s" : "Посетить сайт %s", "Address" : "Адрес", "Profile picture" : "Изображение профиля", diff --git a/lib/l10n/vi.js b/lib/l10n/vi.js index 26a97e89a04..d6e3118de75 100644 --- a/lib/l10n/vi.js +++ b/lib/l10n/vi.js @@ -3,6 +3,21 @@ OC.L10N.register( { "Cannot write into \"config\" directory!" : "Không thể ghi vào thư mục \"config\"!", "See %s" : "Xem %s", + "Email verification" : "Xác thực email", + "Click the following button to confirm your email." : "Nhấn nút sau để xác nhận email của bạn.", + "Click the following link to confirm your email." : "Nhấn liên kết sau để xác nhận email của bạn.", + "Confirm your email" : "Xác nhận email của bạn", + "Other activities" : "Hoạt động khác", + "%1$s and %2$s" : "%1$s và %2$s", + "%1$s, %2$s and %3$s" : "%1$s, %2$s và %3$s", + "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s và %4$s", + "%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s và %5$s", + "Education Edition" : "Bản Giáo dục", + "Enterprise bundle" : "Gói doanh nghiệp", + "The library %s is not available." : "Thư viện %s không có sẵn.", + "The following platforms are supported: %s" : "Các nền tảng sau được hỗ trợ: %s", + "Server version %s or higher is required." : "Yêu cầu máy chủ phiên bản %s hoặc cao hơn.", + "Server version %s or lower is required." : "Yêu cầu máy chủ phiên bản %s hoặc thấp hơn.", "Unknown filetype" : "Không biết kiểu tập tin", "Invalid image" : "Hình ảnh không hợp lệ", "today" : "hôm nay", diff --git a/lib/l10n/vi.json b/lib/l10n/vi.json index a8cc3f04046..c015e56196c 100644 --- a/lib/l10n/vi.json +++ b/lib/l10n/vi.json @@ -1,6 +1,21 @@ { "translations": { "Cannot write into \"config\" directory!" : "Không thể ghi vào thư mục \"config\"!", "See %s" : "Xem %s", + "Email verification" : "Xác thực email", + "Click the following button to confirm your email." : "Nhấn nút sau để xác nhận email của bạn.", + "Click the following link to confirm your email." : "Nhấn liên kết sau để xác nhận email của bạn.", + "Confirm your email" : "Xác nhận email của bạn", + "Other activities" : "Hoạt động khác", + "%1$s and %2$s" : "%1$s và %2$s", + "%1$s, %2$s and %3$s" : "%1$s, %2$s và %3$s", + "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s và %4$s", + "%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s và %5$s", + "Education Edition" : "Bản Giáo dục", + "Enterprise bundle" : "Gói doanh nghiệp", + "The library %s is not available." : "Thư viện %s không có sẵn.", + "The following platforms are supported: %s" : "Các nền tảng sau được hỗ trợ: %s", + "Server version %s or higher is required." : "Yêu cầu máy chủ phiên bản %s hoặc cao hơn.", + "Server version %s or lower is required." : "Yêu cầu máy chủ phiên bản %s hoặc thấp hơn.", "Unknown filetype" : "Không biết kiểu tập tin", "Invalid image" : "Hình ảnh không hợp lệ", "today" : "hôm nay", diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index cdfb123179e..7f855c07d46 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -633,7 +633,7 @@ class AccountManager implements IAccountManager { } // the value col is limited to 255 bytes. It is used for searches only. - $value = $property['value'] ? Util::shortenMultibyteString($property['value'], 255) : ''; + $value = $property['value'] ? Util::shortenMultibyteString($property['value'], 255) : ''; $query->setParameter('name', $property['name']) ->setParameter('value', $value); diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index 6bbab42cb79..0f12dbda629 100644 --- a/lib/private/AppFramework/Http/Dispatcher.php +++ b/lib/private/AppFramework/Http/Dispatcher.php @@ -131,7 +131,7 @@ class Dispatcher { $numExecuted = $databaseStatsAfter['executed'] - $databaseStatsBefore['executed']; if ($numBuilt > 50) { - $this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.' , [ + $this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.', [ 'class' => get_class($controller), 'method' => $methodName, 'count' => $numBuilt, @@ -139,7 +139,7 @@ class Dispatcher { } if ($numExecuted > 100) { - $this->logger->warning('Controller {class}::{method} executed {count} queries.' , [ + $this->logger->warning('Controller {class}::{method} executed {count} queries.', [ 'class' => get_class($controller), 'method' => $methodName, 'count' => $numExecuted, diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index c67500bcaa4..21af2bc46f4 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -303,7 +303,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @return string */ public function getHeader(string $name): string { - $name = strtoupper(str_replace('-', '_',$name)); + $name = strtoupper(str_replace('-', '_', $name)); if (isset($this->server['HTTP_' . $name])) { return $this->server['HTTP_' . $name]; } diff --git a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php index 8bdbacda20b..5f683fa38ac 100644 --- a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php @@ -109,7 +109,7 @@ class RateLimitingMiddleware extends Middleware { */ public function afterException($controller, $methodName, \Exception $exception) { if ($exception instanceof RateLimitExceededException) { - if (stripos($this->request->getHeader('Accept'),'html') === false) { + if (stripos($this->request->getHeader('Accept'), 'html') === false) { $response = new DataResponse([], $exception->getCode()); } else { $response = new TemplateResponse( diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index 9442bd9eca9..3dbcf518f1e 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -356,8 +356,8 @@ class JobList implements IJobList { public function resetBackgroundJob(IJob $job): void { $query = $this->connection->getQueryBuilder(); $query->update('jobs') - ->set('last_run', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) - ->set('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) + ->set('last_run', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) + ->set('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)) ->where($query->expr()->eq('id', $query->createNamedParameter($job->getId()), IQueryBuilder::PARAM_INT)); $query->executeStatement(); } diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 9e35aa828da..aae6f305981 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -38,6 +38,7 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserSession; use OCP\Share\IShare; +use OCP\Mail\IMailer; class MailPlugin implements ISearchPlugin { /* @var bool */ @@ -64,19 +65,23 @@ class MailPlugin implements ISearchPlugin { private $knownUserService; /** @var IUserSession */ private $userSession; + /** @var IMailer */ + private $mailer; public function __construct(IManager $contactsManager, ICloudIdManager $cloudIdManager, IConfig $config, IGroupManager $groupManager, KnownUserService $knownUserService, - IUserSession $userSession) { + IUserSession $userSession, + IMailer $mailer) { $this->contactsManager = $contactsManager; $this->cloudIdManager = $cloudIdManager; $this->config = $config; $this->groupManager = $groupManager; $this->knownUserService = $knownUserService; $this->userSession = $userSession; + $this->mailer = $mailer; $this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes'; $this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes'; @@ -247,8 +252,7 @@ class MailPlugin implements ISearchPlugin { $userResults['wide'] = array_slice($userResults['wide'], $offset, $limit); } - - if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) { + if (!$searchResult->hasExactIdMatch($emailType) && $this->mailer->validateMailAddress($search)) { $result['exact'][] = [ 'label' => $search, 'uuid' => $search, diff --git a/lib/private/Collaboration/Resources/Manager.php b/lib/private/Collaboration/Resources/Manager.php index a0fba16998f..8fc3d0dd5ea 100644 --- a/lib/private/Collaboration/Resources/Manager.php +++ b/lib/private/Collaboration/Resources/Manager.php @@ -131,7 +131,7 @@ class Manager implements IManager { */ public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array { $query = $this->connection->getQueryBuilder(); - $userId = $user instanceof IUser ? $user->getUID() : ''; + $userId = $user->getUID(); $query->select('c.*', 'a.access') ->from(self::TABLE_COLLECTIONS, 'c') diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php index 4d9b43d0787..334006d1706 100644 --- a/lib/private/DB/Adapter.php +++ b/lib/private/DB/Adapter.php @@ -136,7 +136,7 @@ class Adapter { /** * @throws \OCP\DB\Exception */ - public function insertIgnoreConflict(string $table,array $values) : int { + public function insertIgnoreConflict(string $table, array $values) : int { try { $builder = $this->conn->getQueryBuilder(); $builder->insert($table); diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 1262fd4f1ab..9045aa7f879 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -43,7 +43,7 @@ class AdapterPgSql extends Adapter { return $statement; } - public function insertIgnoreConflict(string $table,array $values) : int { + public function insertIgnoreConflict(string $table, array $values) : int { if ($this->isPre9_5CompatMode() === true) { return parent::insertIgnoreConflict($table, $values); } diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 3fb21fbc01c..75611d1ab0f 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -694,7 +694,16 @@ class Encryption extends Wrapper { 'encrypted' => $isEncrypted, ]; if ($isEncrypted) { - $encryptedVersion = $sourceStorage->getCache()->get($sourceInternalPath)['encryptedVersion']; + $sourceCacheEntry = $sourceStorage->getCache()->get($sourceInternalPath); + $targetCacheEntry = $this->getCache()->get($targetInternalPath); + + // Rename of the cache already happened, so we do the cleanup on the target + if ($sourceCacheEntry === false && $targetCacheEntry !== false) { + $encryptedVersion = $targetCacheEntry['encryptedVersion']; + $isRename = false; + } else { + $encryptedVersion = $sourceCacheEntry['encryptedVersion']; + } // In case of a move operation from an unencrypted to an encrypted // storage the old encrypted version would stay with "0" while the diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php index 5faffece67e..6bc66bf9c89 100644 --- a/lib/private/Files/Storage/Wrapper/Wrapper.php +++ b/lib/private/Files/Storage/Wrapper/Wrapper.php @@ -486,7 +486,7 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea /** * Check if the storage is an instance of $class or is a wrapper for a storage that is an instance of $class * - * @param string $class + * @param class-string<IStorage> $class * @return bool */ public function instanceOfStorage($class) { @@ -498,6 +498,25 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea } /** + * @psalm-template T of IStorage + * @psalm-param class-string<T> $class + * @psalm-return T|null + */ + public function getInstanceOfStorage(string $class) { + $storage = $this; + while ($storage instanceof Wrapper) { + if ($storage instanceof $class) { + break; + } + $storage = $storage->getWrapperStorage(); + } + if (!($storage instanceof $class)) { + return null; + } + return $storage; + } + + /** * Pass any methods custom to specific storage implementations to the wrapped storage * * @param string $method diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index f2d91065b9a..271b7a27321 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1182,7 +1182,7 @@ class View { if ($result && in_array('delete', $hooks) and $result) { $this->removeUpdate($storage, $internalPath); } - if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { + if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { $this->writeUpdate($storage, $internalPath); } if ($result && in_array('touch', $hooks)) { @@ -1407,7 +1407,7 @@ class View { } $info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner); - if ($data and isset($data['fileid'])) { + if (isset($data['fileid'])) { if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { //add the sizes of other mount points to the folder $extOnly = ($includeMountPoints === 'ext'); diff --git a/lib/private/Installer.php b/lib/private/Installer.php index b63619b821c..95143656295 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -308,91 +308,80 @@ class Installer { $extractDir = $this->tempManager->getTemporaryFolder(); $archive = new TAR($tempFile); - if ($archive) { - if (!$archive->extract($extractDir)) { - $errorMessage = 'Could not extract app ' . $appId; + if (!$archive->extract($extractDir)) { + $errorMessage = 'Could not extract app ' . $appId; - $archiveError = $archive->getError(); - if ($archiveError instanceof \PEAR_Error) { - $errorMessage .= ': ' . $archiveError->getMessage(); - } - - throw new \Exception($errorMessage); - } - $allFiles = scandir($extractDir); - $folders = array_diff($allFiles, ['.', '..']); - $folders = array_values($folders); - - if (count($folders) > 1) { - throw new \Exception( - sprintf( - 'Extracted app %s has more than 1 folder', - $appId - ) - ); + $archiveError = $archive->getError(); + if ($archiveError instanceof \PEAR_Error) { + $errorMessage .= ': ' . $archiveError->getMessage(); } - // Check if appinfo/info.xml has the same app ID as well - if ((PHP_VERSION_ID < 80000)) { - $loadEntities = libxml_disable_entity_loader(false); - $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); - libxml_disable_entity_loader($loadEntities); - } else { - $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); - } - if ((string)$xml->id !== $appId) { - throw new \Exception( - sprintf( - 'App for id %s has a wrong app ID in info.xml: %s', - $appId, - (string)$xml->id - ) - ); - } + throw new \Exception($errorMessage); + } + $allFiles = scandir($extractDir); + $folders = array_diff($allFiles, ['.', '..']); + $folders = array_values($folders); - // Check if the version is lower than before - $currentVersion = OC_App::getAppVersion($appId); - $newVersion = (string)$xml->version; - if (version_compare($currentVersion, $newVersion) === 1) { - throw new \Exception( - sprintf( - 'App for id %s has version %s and tried to update to lower version %s', - $appId, - $currentVersion, - $newVersion - ) - ); - } + if (count($folders) > 1) { + throw new \Exception( + sprintf( + 'Extracted app %s has more than 1 folder', + $appId + ) + ); + } - $baseDir = OC_App::getInstallPath() . '/' . $appId; - // Remove old app with the ID if existent - OC_Helper::rmdirr($baseDir); - // Move to app folder - if (@mkdir($baseDir)) { - $extractDir .= '/' . $folders[0]; - OC_Helper::copyr($extractDir, $baseDir); - } - OC_Helper::copyr($extractDir, $baseDir); - OC_Helper::rmdirr($extractDir); - return; + // Check if appinfo/info.xml has the same app ID as well + if ((PHP_VERSION_ID < 80000)) { + $loadEntities = libxml_disable_entity_loader(false); + $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); + libxml_disable_entity_loader($loadEntities); } else { + $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); + } + if ((string)$xml->id !== $appId) { throw new \Exception( sprintf( - 'Could not extract app with ID %s to %s', + 'App for id %s has a wrong app ID in info.xml: %s', $appId, - $extractDir + (string)$xml->id ) ); } - } else { - // Signature does not match - throw new \Exception( - sprintf( - 'App with id %s has invalid signature', - $appId - ) - ); + + // Check if the version is lower than before + $currentVersion = OC_App::getAppVersion($appId); + $newVersion = (string)$xml->version; + if (version_compare($currentVersion, $newVersion) === 1) { + throw new \Exception( + sprintf( + 'App for id %s has version %s and tried to update to lower version %s', + $appId, + $currentVersion, + $newVersion + ) + ); + } + + $baseDir = OC_App::getInstallPath() . '/' . $appId; + // Remove old app with the ID if existent + OC_Helper::rmdirr($baseDir); + // Move to app folder + if (@mkdir($baseDir)) { + $extractDir .= '/' . $folders[0]; + OC_Helper::copyr($extractDir, $baseDir); + } + OC_Helper::copyr($extractDir, $baseDir); + OC_Helper::rmdirr($extractDir); + return; } + // Signature does not match + throw new \Exception( + sprintf( + 'App with id %s has invalid signature', + $appId + ) + ); } } diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index 1189907eac9..61f506d2676 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -244,7 +244,7 @@ class Mailer implements IMailer { } [$name, $domain] = explode('@', $email, 2); - $domain = idn_to_ascii($domain, 0,INTL_IDNA_VARIANT_UTS46); + $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46); return $name.'@'.$domain; } diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index b3414a7d290..50f3fa66ab3 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -66,6 +66,7 @@ class Memcached extends Cache implements IMemcache { //\Memcached::OPT_BINARY_PROTOCOL => true, ]; // by default enable igbinary serializer if available + /** @psalm-suppress RedundantCondition */ if (\Memcached::HAVE_IGBINARY) { $defaultOptions[\Memcached::OPT_SERIALIZER] = \Memcached::SERIALIZER_IGBINARY; diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php index 25026575d38..03a3d3f4a7c 100644 --- a/lib/private/Migration/BackgroundRepair.php +++ b/lib/private/Migration/BackgroundRepair.php @@ -97,7 +97,7 @@ class BackgroundRepair extends TimedJob { try { $repair->addStep($step); } catch (\Exception $ex) { - $this->logger->logException($ex,[ + $this->logger->logException($ex, [ 'app' => 'migration' ]); diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index d8bbc02e105..c707884355b 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -381,12 +381,12 @@ class Manager implements IManager { throw new \InvalidArgumentException('The given notification has been processed'); } - if (!($notification instanceof INotification) || !$notification->isValidParsed()) { + if (!$notification->isValidParsed()) { throw new \InvalidArgumentException('The given notification has not been handled'); } } - if (!($notification instanceof INotification) || !$notification->isValidParsed()) { + if (!$notification->isValidParsed()) { throw new \InvalidArgumentException('The given notification has not been handled'); } diff --git a/lib/private/Preview/MarkDown.php b/lib/private/Preview/MarkDown.php index e24bdb5959b..929f319f57d 100644 --- a/lib/private/Preview/MarkDown.php +++ b/lib/private/Preview/MarkDown.php @@ -43,7 +43,7 @@ class MarkDown extends TXT { return null; } - $content = stream_get_contents($content,3000); + $content = stream_get_contents($content, 3000); //don't create previews of empty text files if (trim($content) === '') { @@ -119,7 +119,7 @@ class MarkDown extends TXT { // Get rid of markdown symbols that we still needed for the font size $line = preg_replace('/^#*\s/', '', $line); - $wrappedText = wordwrap($line, $wordWrap,"\n"); + $wrappedText = wordwrap($line, $wordWrap, "\n"); $linesWrapped = count(explode("\n", $wrappedText)); imagettftext($image, $actualFontSize, 0, $x, $y, $textColor, $actualFontSize === $fontSize ? $fontFile : $fontFileBold, $wrappedText); $nextLineStart = (int)($linesWrapped * ceil($actualFontSize * 2)); diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php index d55d32386a7..bb3af6b90de 100644 --- a/lib/private/Preview/TXT.php +++ b/lib/private/Preview/TXT.php @@ -62,7 +62,7 @@ class TXT extends ProviderV2 { return null; } - $content = stream_get_contents($content,3000); + $content = stream_get_contents($content, 3000); //don't create previews of empty text files if (trim($content) === '') { diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php index 175e4cbd356..0688ebba5b3 100644 --- a/lib/private/Security/TrustedDomainHelper.php +++ b/lib/private/Security/TrustedDomainHelper.php @@ -98,7 +98,7 @@ class TrustedDomainHelper implements ITrustedDomainHelper { return true; } // Reject misformed domains in any case - if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) { + if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) { return false; } // Match, allowing for * wildcards diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 8a12465fd8d..920baf3e4ee 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -125,7 +125,7 @@ class MySQL extends AbstractDatabase { $connection->executeUpdate($query); } } catch (\Exception $ex) { - $this->logger->error('Database user creation failed.',[ + $this->logger->error('Database user creation failed.', [ 'exception' => $ex, 'app' => 'mysql.setup', ]); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 548c8a2c451..47b09982f3a 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -847,7 +847,7 @@ class Share extends Constants { * @param array $parameters additional format parameters * @return array format result */ - private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE , $parameters = null) { + private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) { if ($format === self::FORMAT_NONE) { return $items; } elseif ($format === self::FORMAT_STATUSES) { diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index ec0f25cbae5..6e8d9105a76 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -670,7 +670,7 @@ class DefaultShareProvider implements IShareProvider { ); } - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); $qb->orderBy('id'); diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index 2cc8f6ca3fd..abd2ed1dcd8 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -301,8 +301,6 @@ class JSConfigHelper { 'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'), 'slogan' => $this->defaults->getSlogan(), 'logoClaim' => '', - 'shortFooter' => $this->defaults->getShortFooter(), - 'longFooter' => $this->defaults->getLongFooter(), 'folder' => \OC_Util::getTheme(), ]), ]; diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 382179b23e0..753a4a217d1 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -187,7 +187,7 @@ class URLGenerator implements IURLGenerator { $theme = \OC_Util::getTheme(); //if a theme has a png but not an svg always use the png - $basename = substr(basename($file),0,-4); + $basename = substr(basename($file), 0, -4); $appPath = \OC_App::getAppPath($appName); diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php index 1fbc233f535..39faf8e80aa 100644 --- a/lib/private/legacy/OC_DB.php +++ b/lib/private/legacy/OC_DB.php @@ -42,7 +42,7 @@ class OC_DB { * * SQL query via Doctrine prepare(), needs to be execute()'d! */ - public static function prepare($query , $limit = null, $offset = null, $isManipulation = null) { + public static function prepare($query, $limit = null, $offset = null, $isManipulation = null) { $connection = \OC::$server->getDatabaseConnection(); if ($isManipulation === null) { diff --git a/lib/private/legacy/OC_DB_StatementWrapper.php b/lib/private/legacy/OC_DB_StatementWrapper.php index d8e8f0ae37f..d6214a49a33 100644 --- a/lib/private/legacy/OC_DB_StatementWrapper.php +++ b/lib/private/legacy/OC_DB_StatementWrapper.php @@ -59,7 +59,7 @@ class OC_DB_StatementWrapper { /** * pass all other function directly to the \Doctrine\DBAL\Driver\Statement */ - public function __call($name,$arguments) { + public function __call($name, $arguments) { return call_user_func_array([$this->statement,$name], $arguments); } diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php index 2fa7fa1ad36..d12baa400c0 100644 --- a/lib/public/IDBConnection.php +++ b/lib/public/IDBConnection.php @@ -188,7 +188,7 @@ interface IDBConnection { * @return int number of inserted rows * @since 16.0.0 */ - public function insertIgnoreConflict(string $table,array $values) : int; + public function insertIgnoreConflict(string $table, array $values) : int; /** * Insert or update a row value |