Jump to content

Email Obfuscation (EMO)


Roope

Recommended Posts

I've doubled up on javascripts and apparently it's causing an issue.  I recently started working on an interactive map on my site, the problem is that since I'm rendering the HTML on an event (click of the state loads .html(<div>...john@email.com...) ), it's loading the replacement text instead of my email addresses.  Are there any steps I can take to make it work properly without blocking the template altogether?

Thanks for info! Unfortunetaly I don't think there is any other option at the moment and I'm currently very busy with my projects so I don't have any time to debug the module right now but when I do, I'll get back to this. If you have time, you could paste here simplefied test case how to reproduce the issue. Thanks!

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hello guenter!

Umlautes are working fine here - what kind of problems are you facing?

Hi,

for example this is in source :

<!--Email: <span id="emo_email_1" class="emo_email">Enable JavaScript to view protected content.</span><br>-->
<!--Email: <span id="emo_email_2" class="emo_email">Enable JavaScript to view protected content.</span><br>-->
<!--Email: info@kübelgeräte.at<br>-->

happend nothing for info@kübelgeräte.at

Link to comment
Share on other sites

Hello,

On a live development website, powered by ProcessWire 2.7.1, I've just updated Email Obfuscation (EMO) from 1.0.2 to 1.0.4. via the Upgrades module.

Now, on a directory page, the first two email addresses are ok, the third one is "replaced" by the � sign (Firebug -> �

<span id="emo_email_3" class="emo_email"></span>), and all the following ones are replaced by "Enable JavaScript to view protected content.".

(I've just upgraded to ProcessWire 2.7.2, it doesn't change anything.)

Source code

First two email addresses and all the other ones except the third one:

<span id="emo_email_[number]" class="emo_email">Enable JavaScript to view protected content.</span>

Third one:

<span id="emo_email_3" class="emo_email">Enable JavaScript to view protected content.</span>

Link to comment
Share on other sites

Hello Christophe!

 
Could you please tick debug mode on from module admin page and see what it outputs. Found email data is appended to page source after closing </html> tag. Do addresses look ok there?
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hello PWaddict!

 
Haven't use AIOM but according to module readme you have to first enable Directory Traversal Filter:
 
Then choose Load manually as Script file loading method at EMO config page and load required emo.js (or emo.min.js) with AIOM:
<script src="<?php echo AIOM::JS('../modules/EmailObfuscation/emo.min.js'); ?>"></script>
Link to comment
Share on other sites

Hello PWaddict!

 
Haven't use AIOM but according to module readme you have to first enable Directory Traversal Filter:
 
Then choose Load manually as Script file loading method at EMO config page and load required emo.js (or emo.min.js) with AIOM:
<script src="<?php echo AIOM::JS('../modules/EmailObfuscation/emo.min.js'); ?>"></script>

Oh I didn't noticed Directory Traversal Filter at all. LOL

Thank you very much Roope and have a GREAT new year!

Link to comment
Share on other sites

  • 2 weeks later...

Great module you built here Roope.

I just found one issue with it, it detects email addresses in some links. For example google maps links like this: https://www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667,7.2779266,18z/data=!4m2!3m1!1s0x0000000000000000:0xeaf2e4dfe02713bb?hl=en

Here's the debug data from that page:

<!-- 

 EMO DEBUG DATA

 Email crypting took 0,0014450550079346 seconds

 Found 3 matches:

 1[0] = <a href="mailto:info@gad.ch">info@gad.ch</a>
 1[1] = info@gad.ch
 1[2] = info@gad.ch

 Hash: "MaT6r2Kwq+INJ5LhlmNOlFYgljJ6UeiO0C9HlFYgledc45O805NP02YGX5zyJCAgl50cSa3w0jACUBfcro1P"
 Data: <a class="emo_email" href="mailto:info@gad.ch">info@gad.ch</a>

 2[0] = info@example.com
 2[1] = info@example.com
 2[2] = info@example.com

 Hash: "MaT6r2Kwq+INJ5LhlmNOlFYgljJ6UeiO0C9HlFYgledc45O805NP0vwwlv.70ZACl29HM5O805NP0vwwlv.70ZACl29DX2Tp"
 Data: <a class="emo_email" href="mailto:info@example.com">info@example.com</a>

 3[0] = //www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667
 3[1] = //www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667
 3[2] = //www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667

 Hash: "MaT6r2Kwq+INJ5LhlmNOlFYgljJ6UeiO0C9HlFYgledc4HDc3+3+X53cl2370ZACUjNhrv.xX+.7rFzOX90cl5dw3aOclHhQrFSkt+dg0Qdml5qcSBS+XCTuIot2zCqHMHDc3+3+X53cl2370ZACUjNhrv.xX+.7rFzOX90cl5dw3aOclHhQrFSkt+dg0Qdml5qcSBS+XCTuIot2zCqDX2Tp"
 Data: <a class="emo_email" href="mailto://www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667">//www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667</a>

-->

I couldn't really figure out a way to get it to work properly, but there's a workaround for now, we just use the short URLs provided by google maps.

Link to comment
Share on other sites

I just found one issue with it, it detects email addresses in some links. For example google maps links like this: https://www.google.ch/maps/place/Fondation+gad+Stiftung/@47.1215667,7.2779266,18z/data=!4m2!3m1!1s0x0000000000000000:0xeaf2e4dfe02713bb?hl=en

Thanks flo!

 
Just pushed a fix to github. Please update and see if it helps.
Link to comment
Share on other sites

  • 8 months later...

Thank you Roope for the great module! :rolleyes:

But unfortunately I can't get to work ???

  • installed propper
  • placed the script in the head section manually:
    <?php echo '<script src="/site/modules/EmailObfuscation/emo.min.js"></script>'; ?>
  • script file loading method is set to "manually"
  • script loads propper in head
  • but, the e-mail addresses are not converted within span elements

It looks like the module does not interfere at all. Any suggestions???

Link to comment
Share on other sites

Nope, no emo_addr array is present :(

I guess you mean this part of the module:

		// create addresses script block
		$addrScript = "\n<!-- emo -->\n<script>\n var emo_addr = new Array();\n";
		$addrScript .= "{$this->addrScript} addLoadEvent(emo_replace());\n</script>\n"

It looks to me as if the module is not active. Either the emo_addr array nor the addLoadEvent are implemented. *weird* :huh:

Link to comment
Share on other sites

Do you have a closing body tag in your html output? The module uses that to add the script block.

The function addLoadEvent is in emo.min.js.

Also make sure you haven't applied any template exclusion in the module settings, just to make sure.

Link to comment
Share on other sites

Thank you tpr.
Closing body tag </body> is present in the html output.

Quote

Also make sure you haven't applied any template exclusion in the module settings, just to make sure.

-> this is empty / none template is applied to exclusion.

Link to comment
Share on other sites

8 hours ago, Bacelo said:

Thank you Roope for the great module! :rolleyes:

But unfortunately I can't get to work ???

  • installed propper
  • placed the script in the head section manually:
    <?php echo '<script src="/site/modules/EmailObfuscation/emo.min.js"></script>'; ?>
  • script file loading method is set to "manually"
  • script loads propper in head
  • but, the e-mail addresses are not converted within span elements

It looks like the module does not interfere at all. Any suggestions???

Hello @Barcelo!

So email addresses are replaced by text set in module config but conversion back to email doesn't kick in, right? Double check that emo.js is really present because it sounds like there's the issue here. Maybe consider adding modules config url to the file path:

<?php echo '<script src=" . $config->urls->modules . EmailObfuscation/emo.min.js"></script>'; ?>

 

Link to comment
Share on other sites

Feature request: one thing that would be cool is to be able to enable this only for some templates, instead of disable;
because i only need it on the contact page, so i'd need to disable like 30 templates, rather than enable 1, the way it is currently;

Is there any way of conditionally loading this module by the API?

One of the really critical issues here is that the module is still not able to skip stuff like twitter handle (e.g. @processwire)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...