Skip to content

fix(appearance): ICO favicons upload, SVG is no longer offered, names follow the content - #462

Merged
Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:fix/favicon-ico-no-svg
Nov 18, 2026
Merged

Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:fix/favicon-ico-no-svg

Conversation

@ertugrulkeyvan

Copy link
Copy Markdown
Contributor

Fixes #456.

What was wrong

The favicon form says "PNG, ICO, SVG" and the logo form says "PNG, JPG, SVG, WebP". Both validate with Laravel's image rule, which accepts jpg, jpeg, png, gif, bmp and webp, and SVG only with image:allow_svg. So:

  • an .ico favicon, the most common kind, was refused;
  • SVG never worked on either form.

The change

  • Favicon: the rule is now file|mimes:png,ico, so .ico uploads work.
  • SVG stays out, on purpose. The uploaded file is served from public/branding, on the panel's own origin. A script inside an SVG would run there. Allowing it safely means sanitizing the SVG, which is a bigger change. SVG is removed from both hints (in the nine languages that have them) and from the file pickers' accept.
  • The stored file name used the extension the browser sent. The rule checks the content, so a PNG sent as logo.html passed and was saved as logo_<time>.html. The extension now comes from the content (guessExtension()), the same thing the rule checked.

Tests

tests/Feature/BrandingUploadTest.php has 4 tests. The ICO and file-name tests use a real temporary file rather than UploadedFile::fake(), because the fake takes the file type from the name, not from the bytes. On main, 3 of the 4 fail: ICO, SVG/hints, and the file name. The PNG test passes on both. With the change, all 4 pass. Full suite: 5,430 passed; the 2 failures (CurrencyAndBackupTest, MailLinkHostTest) fail the same way on main.

… follow the content

The favicon form said "PNG, ICO, SVG" and the logo form "PNG, JPG, SVG,
WebP", but both used Laravel's image rule, which has neither ICO nor SVG.
So an .ico favicon, the most common kind, was refused, and SVG never
worked anywhere (Panelica#456).

- favicon: 'file|mimes:png,ico', so .ico uploads work.
- SVG stays out on purpose: the file is served from public/branding on
  the panel's own origin, where a script inside an SVG would run. It is
  removed from both hints (nine languages) and from the file pickers.
- The stored name took the extension the browser sent. A PNG uploaded as
  logo.html passed the rule and was saved as logo_<time>.html, served as
  a page from the panel's origin. The extension now comes from the
  content (guessExtension), the same check the rule made.

Fixes Panelica#456.
@Panelica
Panelica merged commit 398b580 into Panelica:main Nov 18, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged, thank you.

Verified the reasoning: Laravel's image rule has no ICO at all, so every .ico upload was refused while the form offered it; and the stored name now follows guessExtension(), so a PNG sent as logo.html cannot be served as a page. Keeping SVG out of a file served from the panel's own origin is the right call.

3 of 4 tests red on 1.29.0 (the PNG case is the guard). Measured on the merge result: the full suite is green — 5463 passed in parallel (--exclude-group=serial, 4 processes) plus the 17 serial installer tests, 5 skipped, 0 failed.

@Panelica

Copy link
Copy Markdown
Owner

Released in 1.30.0, the stable channel, offered to every installation.

Gates on the tag and that package: full suite 5463 passed in parallel plus the 17 serial installer tests (0 failed, 5 skipped); 276 translation and parity tests green; the update lab 14 scenarios ALL GREEN; the real package updated the last stable (1.29.0 → 1.30.0, 13 checks) and the last beta (1.25.1-beta.1 → 1.30.0, 14 checks), each installed from its published package in the published runtime image with the signature checked by the key built into the application; the three uploaded assets re-downloaded and compared byte for byte before publishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Favicon upload rejects SVG although the form says SVG is accepted

2 participants