diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index cd1889264b3e3..9f42d974ecfec 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -168,7 +168,7 @@ private function logUpdate(IChange $change, OutputInterface $output): void { } private function getStorageIds(int $mountId, string $path): array { - $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($path), '/')); + $pathHash = md5(trim(\OC_Util::normalizeUnicode($path), '/')); $qb = $this->connection->getQueryBuilder(); return $qb ->select('storage_id', 'user_id') @@ -176,12 +176,12 @@ private function getStorageIds(int $mountId, string $path): array { ->innerJoin('m', 'filecache', 'f', $qb->expr()->eq('m.storage_id', 'f.storage')) ->where($qb->expr()->eq('mount_id', $qb->createNamedParameter($mountId, IQueryBuilder::PARAM_INT))) ->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter($pathHash, IQueryBuilder::PARAM_STR))) - ->execute() + ->executeQuery() ->fetchAll(); } private function updateParent(array $storageIds, string $parent): int { - $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($parent), '/')); + $pathHash = md5(trim(\OC_Util::normalizeUnicode($parent), '/')); $qb = $this->connection->getQueryBuilder(); return $qb ->update('filecache') diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 49ce3c7b0549c..011072a99e774 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1766,7 +1766,6 @@ - @@ -2026,11 +2025,6 @@ - - - - - namesCache]]> namesCache]]> diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index f82082d3d129f..31d7df8960d21 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -937,18 +937,18 @@ public static function getTheme() { } /** - * Normalize a unicode string + * Normalize a unicode string. * * @param string $value a not normalized string - * @return bool|string + * @return string The normalized string or the input if the normalization failed */ - public static function normalizeUnicode($value) { + public static function normalizeUnicode(string $value): string { if (Normalizer::isNormalized($value)) { return $value; } $normalizedValue = Normalizer::normalize($value); - if ($normalizedValue === null || $normalizedValue === false) { + if ($normalizedValue === false) { \OCP\Server::get(LoggerInterface::class)->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); return $value; }