fix(preview): Validate preview MIME type#58793
Conversation
Signed-off-by: Git'Fellow <[email protected]>
b642762 to
304c9fb
Compare
|
/backport to stable33 |
|
The backport to # Switch to the target branch and update it
git checkout stable33
git pull origin stable33
# Create the new backport branch
git checkout -b backport/58793/stable33
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 304c9fbc
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58793/stable33Error: Failed to push branch backport/58793/stable33: remote: Invalid username or token. Password authentication is not supported for Git operations. Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
/backport to stable33 |
|
/backport to stable32 |
|
The backport to # Switch to the target branch and update it
git checkout stable32
git pull origin stable32
# Create the new backport branch
git checkout -b backport/58793/stable32
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 304c9fbc
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58793/stable32Error: Failed to check for changes with origin/stable32: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
Summary
When generating previews, malformed dimensions can produce a preview image with a null MIME type.
This validates the preview object and its MIME type after resize/crop operations and before creating the DB record. If the preview is invalid or has a null MIME type an InvalidArgumentException is thrown and the file is skipped instead of crashing.
Checklist
3. to review, feature component)stable32)AI (if applicable)