mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #741] Broken icon image when using a theme that alters icon colors #460
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#460
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jasonmunro on GitHub (Aug 9, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/741
🐛 Bugreport
I noticed this on mobile with a dark theme. The "three dots" icon above a message list is not displaying correctly.
Version & Environment
Rev: current master
OS: NA
Steps to reproduce
Themes can modify icon colors, which happens here: https://github.com/cypht-org/cypht/blob/master/modules/themes/modules.php#L193 This code adds a "fill" attribute to the svg tag. However there MUST be a space at the end of the svg tag before the closing characters, otherwise the fill attribute is not correctly formatted. For example:
<svg path="..." />this is ok, there is a space before the tag closes
<svg path="..."/>This is not ok, there is no space before the tag closes. Without the space adding the fill attribute causes the path and fill attributes to not have a space separating them which is invalid.
@jasonmunro commented on GitHub (Aug 9, 2023):
an easy fix for this would be to pad the fill attribute with a space when doing the string replace. In the themes modules just change this:
Hm_Image_Sources::$$name = $pre.rawurlencode(str_replace('/>', 'fill="'.$color.'" />', $img));to this:
Hm_Image_Sources::$$name = $pre.rawurlencode(str_replace('/>', ' fill="'.$color.'" />', $img));@marclaporte commented on GitHub (Aug 9, 2023):
Thank you @jasonmunro
This is a good first commit for one of our new devs.