https://bugs.kde.org/show_bug.cgi?id=328815

--- Comment #5 from Elvis Angelaccio <elvis.angelac...@kde.org> ---
Git commit ce17329c915b5d37a15011823269a97c97f3a2d3 by Elvis Angelaccio.
Committed on 25/08/2024 at 10:31.
Pushed by elvisangelaccio into branch 'master'.

Fix validation of tar mimetypes

The validation code was ignoring any alpha chars *after* the extension,
which might be a pretty common case (e.g. one copies a foo.tar.gz file
into a foo.tar.gz_backup file or whatever).

It's not worth to fix this code, as it already has enough hacks added
over time.

The new approach introduced with this commit is much simpler: we just look
for the longest match between the filename's complete suffix and the
suffixes supported by the libarchive plugin. If we found a match, we
just replace it in place of the original complete suffix.

If the original suffix doesn't match, we try its stripped down version
(with non-alpha chars removed), as the old code did (see the CCBUG).

A bunch of test cases have been added (they did not pass before this
commit).

M  +10   -0    autotests/kerfuffle/mimetypetest.cpp
M  +38   -36   kerfuffle/mimetypes.cpp

https://invent.kde.org/utilities/ark/-/commit/ce17329c915b5d37a15011823269a97c97f3a2d3

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to