Fix favicon: strip #joomlaImage:// fragment from media field path
Some checks failed
Repo Health / Access control (push) Successful in 1s
Repo Health / Release configuration (push) Failing after 4s
Repo Health / Scripts governance (push) Successful in 4s
Repo Health / Repository health (push) Failing after 3s

Joomla's media field appends #joomlaImage://local-images/... to the
path. strtok($path, '#') strips everything after the hash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-18 15:18:36 -05:00
parent e8f355f32e
commit 78affe89d6

View File

@@ -75,7 +75,8 @@ if ($params_favicon_source) {
// 'images/logo.png' (images folder)
// 'media/templates/site/mokocassiopeia/images/logo.png' (template media)
// 'logo.png' (bare filename)
$faviconSourceRel = ltrim($params_favicon_source, '/');
// Strip Joomla's #joomlaImage:// fragment from media field value
$faviconSourceRel = strtok(ltrim($params_favicon_source, '/'), '#');
$faviconSourceAbs = JPATH_ROOT . '/' . $faviconSourceRel;
// Try common prefixes if not found
if (!is_file($faviconSourceAbs)) {