Events Made Easy Forums How do I … Event tamplate + #_contacemail

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #62934
    Anonymous
    Inactive

    Hello Franky,

    I have a strange problem.
    I use the plugin CryptX to display email addresses, this has worked for years without problems.
    Currently the following problem occurs, with most email addresses everything works as expected. With some addresses the HTML tags are enclosed by entities.
    Here are two events, both created at the same time.
    https://jof.spdns.de/wordpress/lkc-aktuell/termin/test-event2/
    https://jof.spdns.de/wordpress/lkc-aktuell/termin/test-event1/
    With the first event everything is ok, with the second the problem occurs.
    Do you have any idea?

    Kind regards
    Friedhelm

    #62970
    Franky
    Keymaster

    No idea … search for the differences in the 2 events 🙂
    EME already protects #_CONTACTEMAIL, so maybe that’s the problem ?
    The filter eme_email_obfuscate_filter can influence this.

    #63869
    Anonymous
    Inactive

    Hi Franky,

    I’m a little late… At the time I didn’t have the time or the inclination to deal with it.

    The current installation:
    WP V5.5.4 multissite
    Eme V2.2.58
    cryptX V3.3.3.2
    I have been using eme and crypX together for many years without any problems.

    The following applies to both events
    – both events are identical, they only differ by a different contact person.
    – The filter eme_email_obfuscate_filter is activated (add_filter ….) In this function the functionality of the plugin CryptX is used to mask the email address.

    What I noticed:
    1.) For the “test event1” (email link with the entities):
    – The filter eme_email_obfuscate_filter is used. The correct email address is passed as argument. The return value is the correct link with the masked email address.
    Afterwards eme ist checked the value with the function esc_html() – this is where the entities in the a-tag come from.
    – The whole thing only happens with newly created WordPress users.

    2.) For the “test event2” (all is well):
    – The filter eme_email_obfuscate_filter is active, but not called by eme.
    – The contact person is a WordPress user who has been created a long time ago.

    I have no explanation for the different handling of wordpress users. I have created several new users and used them as contact persons, always with the same result. I have looked at the users/usermetas tables in the database with no tangible results.

    Something is wrong and I don’t know what.
    Do you have a better idea?

    #63870
    Franky
    Keymaster

    What do you mean with “The filter eme_email_obfuscate_filter is active, but not called by eme” ?
    Also, what is the template/format you use to display your event?

    #63871
    Franky
    Keymaster
    #63873
    Anonymous
    Inactive

    Thank you for your feedback.
    I hope I can answer your questions.
    I apply the filter normally:
    ‘add_filter( ’eme_email_obfuscate_filter’, array( $this, ‘set_mail_obfuscate_filter’ ) , 10, 1 );’ (called in a class).
    In standard use, the whole thing is used in function.php. In this case, I use it in a separate plugin.

    Now for the results:
    In test event2, the filter is not used by the plugin EME, no argument is passed. However, the email address is masked by CryptX.
    I tried the whole thing again in a clean WP instance, only Eme and ccryptX were installed as plugin. The results are identical to the two test events above.
    As a reminder, in test event 1 the email address is passed through the eme_email_obfuscate_filter.

    Regarding the templates, I use many user-defined templates, I have tested again with a slimmed-down variant, it is not due to the template.
    ‘#_STARTDATE – #_STARTTIME<br />#_TOWN<br />#_NOTES<br />Kontakt: #_CONTACTNAME, E-Mail: #_CONTACTEMAIL<br />#_ADDBOOKINGFORM.’

    I haven’t tried your patch yet, I’ll get back to you.

    #63874
    Anonymous
    Inactive

    I have just tested your code changes.
    Your changes to the code work great, everything is perfect in the frontend.

    Thank you very much for that.

    But the open question about the use of the eme_email_obfuscate_filter remains open.
    Nothing has changed in the use of the eme_email_obfuscate_filter.
    All users have a valid email address, a part of these addresses is passed to the filter, the other part is not. The part that is not passed is still masked.
    Why? Do you have an explanation?

    #63875
    Franky
    Keymaster

    There’s no such thing in the code that passes “part” of the email to the filter. However, only contact emails for an event/membership are obfuscated currently. This change should fix that so normal email addresses are obfuscated too (however I don’t understand why someone would show emails of a booker on the site):
    https://plugins.trac.wordpress.org/changeset/2677925/

    #63876
    Anonymous
    Inactive

    I probably didn’t make myself clear.
    I am only concerned with the contact person (when creating an event in the backend) and the display in the frontend via the placeholder #_CONTACTEMAIL.
    If I am informed correctly, only a wordpress user (a user with a wordpress account for this home page) can be selected as the contact person.
    So I only need the contact person and possibly the author of the event for the display in the frontend.

    I experimented a bit more and noticed the following:
    The filter (eme_email_obfuscate_filter) is not used for all wordpress users who have an entry in the table eme_peoble, e.g. because they have registered for some event.
    The filter is used for all other WordPress users.

    #63877
    Franky
    Keymaster

    And I admit I wasn’t complete in my explanation either. Indeed: if a contact person was linked to an EME user, the info from that user was taken and the filter wasn’t applied. This is fixed with the last changeset above too. A byproduct of an older change a year or so ago … this last change should fix things.

    #63878
    Anonymous
    Inactive

    Thanks for the explanation, I will test your changes tomorrow.

    #63879
    Anonymous
    Inactive

    Wonderful, everything works as expected.

    Thank you for your quick help.

    #63880
    Franky
    Keymaster

    I just realized that the email obfuscation filter also runs for html mails. A filter that replaces the email with javascript will thus render things unreadable in the mail. I’ve now added code to rectify that (will be in the next version).

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top