Fix incoming webhook file extension detection - #2402
Open
mysubcult wants to merge 1 commit into
Open
Conversation
remdex
requested changes
Aug 7, 2026
| } | ||
| } | ||
|
|
||
| public static function getExtensionByMime($mimeType, $getMime = false) { |
Contributor
There was a problem hiding this comment.
that's the only changes required in that function everything else is not related... Because if that pull request won't be accepted.
Contributor
Author
There was a problem hiding this comment.
Updated. I removed the changes from getExtensionByMime() and narrowed the PR to the incoming webhook file extension handling only. It now uses the existing extension/MIME map and the filename provided by the webhook, without adding MIME aliases.
mysubcult
force-pushed
the
fix-incoming-webhook-file-extension-20260807
branch
from
August 7, 2026 10:19
c140229 to
acb0b52
Compare
mysubcult
force-pushed
the
fix-incoming-webhook-file-extension-20260807
branch
2 times, most recently
from
August 7, 2026 10:21
79f508a to
b025870
Compare
mysubcult
force-pushed
the
fix-incoming-webhook-file-extension-20260807
branch
from
August 7, 2026 10:22
b025870 to
e07b6a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Some integrations expose media through generic endpoints such as /ru/getfile while also providing the real filename, for example NISSAN.rar. In that case LHC can derive an invalid extension from the URL and later reject the file during download because extension and MIME do not match.
Testing