ProfessionalWiki / ExternalContent

MediaWiki extension that allows embedding external content
https://professional.wiki/en/news/external-content
GNU General Public License v2.0
6 stars 4 forks source link

File extension detection fails with BitBucket branch #40

Closed malberts closed 9 months ago

malberts commented 9 months ago

With a URL like this:

{{#bitbucket:http://bitbucket:7990/projects/TEST/repos/test/browse/test.php?at=test}}

This code does not detect the right extension: https://github.com/ProfessionalWiki/ExternalContent/blob/a4dd4481824ba8cbd74e1ad540ffccfd861788a5/src/UseCases/Embed/EmbedUseCase.php#L82-L84

The query string needs to be stripped, otherwise the file extension is detected as php?at=test.

This does not happen when embedding GitHub files, because the branch is part of the path and not a query string.

AC: