Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe-email shortcode no longer working? #75

Closed
paulhibbitts opened this issue Sep 5, 2019 · 9 comments
Closed

Safe-email shortcode no longer working? #75

paulhibbitts opened this issue Sep 5, 2019 · 9 comments

Comments

@paulhibbitts
Copy link

paulhibbitts commented Sep 5, 2019

In the past I've used the Safe-email shortcode and I thought when I first checked the resulting html via "view-source" the email address info was obfuscated. I've just started to use the shortcode again (after I recommended it to another educator for their course site) but I seem to have the email address in plain text:

<i class="fa fa-envelope"></i> <a href="mailto:[email protected]" class="mailto">[email protected]</a>

Here is the shortcode syntax I am using:
[safe-email autolink="true" icon="envelope"][email protected][/safe-email]

Am I doing something wrong or is this an issue with the Plugin?

Thanks very much,
Paul
ps - here is a live site with an example, please see the sidebar https://paulhibbitts.net/cmpt-363/193/home

@rhukster
Copy link
Member

rhukster commented Sep 5, 2019

The Inspector will show it as plain text, but "view source" should show it obfuscated.

It doesn't appear to be obfuscated on your site though.

It is working on my test site with the shortcode:

<h3>Safe Email</h3>

 <p>Safe-Email Address: <i class="fa fa-envelope-o"></i> <a href="mailto:&#117;&#115;&#101;&#114;&#64;&#100;&#111;&#109;&#97;&#105;&#110;&#46;&#99;&#111;&#109;">&#117;&#115;&#101;&#114;&#64;&#100;&#111;&#109;&#97;&#105;&#110;&#46;&#99;&#111;&#109;</a></p>

@paulhibbitts
Copy link
Author

paulhibbitts commented Sep 5, 2019

Thanks so much for confirming it does work on your end @rhukster. I just tested with my Open Publishing Space and it is not obfuscating there either. I will try to dig deeper to see if it is something those two skeletons share (BTW, both themes have their own custom shortcodes, but I do not see that a factor).

ps - I've justed tested using the standard Quark theme and same result, will continuing digging🙂

@paulhibbitts
Copy link
Author

paulhibbitts commented Sep 5, 2019

Hi @rhukster , I think I've tracked down the issue at least in one case. With my Bootstrap4 Open Matter the External Links Plugin is a dependency and when this Plugin is Enabled the safe-mail shortcode does not seem to work. Once it is disabled it works, and also if you set the External Links Plugin Order of execution to 1. So, now this site works👍https://paulhibbitts.net/cmpt-363/193/home

However, for some reason in my Quark Open Publishing theme the above alone does not get the safe-mail shortcode work - I also need to disable the Image Captions plugin... any ideas?

Thanks very much,
Paul
ps - please let me know if any additional information is helpful etc

@rhukster
Copy link
Member

rhukster commented Sep 5, 2019

I will install imageCaptions in parallel and test.

@rhukster
Copy link
Member

rhukster commented Sep 5, 2019

OK, i can confirm that with image-captions a similar issue occurs.. It's basically because those plugins are doing manipulation in the same event as shortcode-core, and shortcode-core is running first, and obfuscating the email correctly, but when the other plugins do their thing, that encoded HTML is automatically decoded back to normal.

You were on the right track, but rather than making the external links plugin run earlier, i'm going to ensure the shortcode-core plugin runs later (ie, -10 order), this way it should always run last after other plugins that use the same event.

@paulhibbitts
Copy link
Author

Thanks very much @rhukster, it's great you were able to replicate the issue! Your solution sounds perfect👍Thank you.

@rhukster
Copy link
Member

rhukster commented Sep 5, 2019

and released

@rhukster rhukster closed this as completed Sep 5, 2019
@paulhibbitts
Copy link
Author

Works perfectly, thanks again Andy!

@OleVik
Copy link

OleVik commented Sep 15, 2019

Just to note, this change will have broken rendering in events hooking into onPageContentProcessed and using Shortcode Core for third-party shortcodes. To remedy this, event priorities should be changed to be lower or equal to - per Admin#999 - the new -10.

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

No branches or pull requests

3 participants