Skip to content

Conversation

@mbraam
Copy link

@mbraam mbraam commented Jan 8, 2026

Allow for .ico files coming from a customized branding extension to be displayed as favicon in the browser.

Base information

Question Answer
Related to a SourceForge thread / Another PR / Combodo ticket? No
Type of change? Bug fix

Symptom (bug)

  • The XML Datamodel for creating extensions allows since iTop 3.2.0 to include favicons (main_favicon, portal_favicon and login_favicon)
  • The .ico file format is the original and commonly used file format for favicons
  • However, files with this extension are currently not shown on iTop instances running on Apache with recommended security settings applied.

Reproduction procedure (bug)

  1. create an extensions that includes .ico files and place a reference to these files in the section, under <main_favicon>, <portal_favicon> and/or <login_favicon>.
  2. Install this extension on iTop 3.2.2-1-17851 (installed on a LAMP stack)
  3. With PHP 8.3.6
  4. Login and observe the .ico file is not displayed and as a fallback the default iTop favicon is displayed.

Cause (bug)

For iTop instances served by Apache, the current .htaccess file in env-production prevent .ico files (located in env-production/branding) to be displayed by the browser as favicon,
This is due to the statement: <FilesMatch ".+.(css|scss|js|map|png|bmp|gif|jpe?g|svg|tiff|woff2?|ttf|eot)$">

Proposed solution (bug and enhancement)

I replaced both occurences of the statement <FilesMatch ".+.(css|scss|js|map|png|bmp|gif|jpe?g|svg|tiff|woff2?|ttf|eot)$"> with <FilesMatch ".+.(css|scss|js|map|ico|png|bmp|gif|jpe?g|svg|tiff|woff2?|ttf|eot)$">

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • I have added a unit test, otherwise I have explained why I couldn't
  • Is the PR clear and detailed enough so anyone can understand digging in the code?

Checklist of things to do before PR is ready to merge

Confirm that this .htaccess file is also to be copied to the env-production folder during setup of iTop.
I did not write a unit test, as there is no code to test here. The .htaccess file is a configuration file used by Apache.

Allow for .ico files coming from a customized branding extension to be displayed as favicon in the browser.
Copy link
Contributor

@Molkobain Molkobain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @mbraam , thanks for the PR :)

It's a good idea, but in that case we should also update all access restrictions files that allow images to have the same behavior:

  • .htaccess (Apache) and web.config (IIS) files generated in the env-xxx folders.
  • .htaccess (Apache) and web.config (IIS) files in the /lib and /node_modules folders.

@Molkobain Molkobain added the bug Something isn't working label Jan 9, 2026
@Hipska
Copy link
Contributor

Hipska commented Jan 9, 2026

Probably only there? Won't the files from the branding extension be placed there instead of /lib?

@Molkobain
Copy link
Contributor

Molkobain commented Jan 9, 2026

Probably only there? Won't the files from the branding extension be placed there instead of /lib?

Exact, but as we allow images from the third party folders, I think we should also fix /lib and /node_modules (which I forgot in my previous message) at the same time.

@Molkobain
Copy link
Contributor

Molkobain commented Jan 9, 2026

I updated my first comment as there are also the IIS files to update 😅

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

Labels

bug Something isn't working

Projects

Status: First review needed

Development

Successfully merging this pull request may close these issues.

3 participants