Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some files are recognized as SVG incorrectly, make the diff UI unable to work. #19733

Closed
stuzer05 opened this issue May 17, 2022 · 2 comments · Fixed by #23312
Closed

Some files are recognized as SVG incorrectly, make the diff UI unable to work. #19733

stuzer05 opened this issue May 17, 2022 · 2 comments · Fixed by #23312
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@stuzer05
Copy link

stuzer05 commented May 17, 2022

Description

When certain conditions are met gitea can't display the blade.php file diff when viewing the commit. It only works when I click "View source button". Second link is taken from network, it is causing the crash.

https://try.gitea.io/stuzer05/test-preview/commit/f97b3784f8c8efc222128f6dffd4e5abb5fda462
https://try.gitea.io/stuzer05/test-preview/raw/commit/e2f752e123151fea55959571d56d57462025f0f6/test.blade.php

image

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker

Database

No response

@wxiaoguang
Copy link
Contributor

The file was recognized as SVG incorrectly.

https://try.gitea.io/stuzer05/test-preview/raw/commit/e2f752e123151fea55959571d56d57462025f0f6/test.blade.php

Response header:

content-type | image/svg+xml

@wxiaoguang wxiaoguang changed the title Crash previewing laravel's blade diff files Some files are recognized as SVG incorrectly, make the diff UI unable to work. May 17, 2022
@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label May 17, 2022
@lunny
Copy link
Member

lunny commented May 17, 2022

By the extension name, it's not a svg file.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
3 participants