From ffeb797eccfc90e5cf53d5737d58bfb1346f8718 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 19 Oct 2023 16:27:07 +0200 Subject: refactor(mimeloader): modernize MimeTypeLoader Signed-off-by: Thomas Citharel --- lib/private/Files/Cache/SearchBuilder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/private/Files/Cache') diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 9d306db7748..e8063b77aa5 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -228,18 +228,18 @@ class SearchBuilder { if ($field === 'mimetype') { $value = (string)$value; if ($type === ISearchComparison::COMPARE_EQUAL) { - $value = (int)$this->mimetypeLoader->getId($value); + $value = $this->mimetypeLoader->getId($value); } elseif ($type === ISearchComparison::COMPARE_LIKE) { // transform "mimetype='foo/%'" to "mimepart='foo'" if (preg_match('|(.+)/%|', $value, $matches)) { $field = 'mimepart'; - $value = (int)$this->mimetypeLoader->getId($matches[1]); + $value = $this->mimetypeLoader->getId($matches[1]); $type = ISearchComparison::COMPARE_EQUAL; } elseif (str_contains($value, '%')) { throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported'); } else { $field = 'mimetype'; - $value = (int)$this->mimetypeLoader->getId($value); + $value = $this->mimetypeLoader->getId($value); $type = ISearchComparison::COMPARE_EQUAL; } } -- cgit v1.2.3