Closed gchriz closed 2 years ago
The commit should fix the issue that the FontAwesome symbol appears twice if email enryption is active. As far as I can see, it works as expected.
Ah, I see.
For example the template caminar-wbce uses this line:
<a href="mailto:mail@example.com" class="icon fa-envelope-o"><span class="label">Email</span></a>
Since there is only a single reference to the fa-envelope-o and that one gets removed, it's gone completely.
So I need to add another class attribute elsewhere like in your example above...
Or the email filter script might count the occurrences of FontAwesome things within the .. and only remove them when there are more than one. Or something like this.
This
<a href="mailto:mail@example.com" class="icon fa-envelope-o"><span class="label">Email</span></a>
is not the by FontAwesome recommended way how to build an email link. Please refer to https://fontawesome.com/v4/examples/ to see how a FA link usually should look like, because that is the only way to avoid issues with the filter.
O.k. Then I'll fix the template locally.
Thank you for the explanations!
I didn't expect to become a template programmer, though! ;-) If I find a place to report my fixes to template caminar-wbce I'll post them there.
When using email-address encryption by _mod_opfemail the (optional) class attribute is removed from the resulting mailto link.
But only if the class contains/uses a fontawesome-class, for example
<a href="mailto:....." class="icon fa-envelope-o">
, to display an envelope icon.For example the template _caminarwbce uses it in its footer line.
Checking
modules/mod_opf_email/filter.php
reveals this:That if() construct was introduced on May 31, 2021 in commit 907404dd8119bf19141cee7d337a8795479b10c6
IMHO it is not correct. It suppresses the complete class attribute if it contains any fontawesome class?!?! But why?
I reversed it by switching false to true. But the whole reason for the if() isn't clear to me. So I might be wrong.
At least my resulting mailto links have their icons back now. ;-)