Jump to content

Roope

Members
  • Content Count

    204
  • Joined

  • Last visited

Community Reputation

104 Excellent

About Roope

  • Rank
    Distinguished Member

Contact Methods

  • Website URL
    https://www.blowback.fi/

Profile Information

  • Gender
    Male
  • Location
    Tampere, Finland

Recent Profile Visitors

4,691 profile views
  1. Yes, I'm well aware that it is completely valid to have inputs and such outside of a form element and with email address EMO breaks the markup but I thought this was not the issue in your case since there was already previous post from creativejay about problems with FormBuilder and you also mentioned that EMO shoudn't touch values of form elements but you were literally talking about inputs and such, not the form element itself. Sorry about that. There are also another technically valid situations where EMO fails e.g. like having an email inside data attribute. Generally it is kind of compicated topic to automatically replace email address by new node in every possible case without breaking things. Anyway, current state where EMO skips whole content inside form element is not ideal since there are many cases where you can have email addresses inside form where they should get obfuscated but currenly are not. Like the one in my previous form example where email inside p element should be touched but it's not. That said maybe we should remove the form element completely from ignored elements and concentrate only at form elements (what you suggested actually) like input, option and textarea where most likely touching email addresses will give us headaches. I'll look into it.
  2. Hi all! Issue with script insert to the head section is now fixed in version 1.2.3 https://github.com/BlowbackDesign/EmailObfuscation/releases/tag/1.2.3 @CalleRosa40 and @Brian Williamson please update and report back if you're still facing any problems. @creativejay and @Robin S - EMO has skipped form tags on obfuscation since day one and I haven't been able to reproduce this error so I'm kind of lost here why are you guys facing this issue with recent 1.2.x update. For example, none of the addresses in the markup below are not touched: <form action="/"> <p>john@doe.com</p> <input type="text" name="email" value="john@doe.com"> <textarea name="message">john@doe.com</textarea> </form> Using no-emo class on element to avoid obfuscation is a nice idea but not so easy to implement safely to the current logic based on regular expressions.
  3. Hello @CalleRosa40 and @Brian Williamson! And thanks for the notice! The logic with EMO insert changed at 1.2.x update and I haven't got time to push the update yet so in a meantime please use the version 1.1.1 instead as it works without any issues. I'll try to find some time to fix the script insert to head ASAP! https://github.com/BlowbackDesign/EmailObfuscation/releases/tag/1.1.1
  4. Hello @gebeer (and @grimezy) and thanks for the info! I was able to reproduce this and it was purely silly mistake I made when I was rearranging stuff. The is_array check in this condition is there only to prevent such a warning in array_key_exists function. This is now fixed in 1.2.1 version. And finally in 1.2.2 version. While I was there I also added conditional autoload to block admin pages which is proposed by @tpr in this thread already long ago. Thanks!
  5. I can't confirm. Running PW 3.0.123 + latest versions on both of modules. What kind of issues are you facing?
  6. New EMO version 1.2.0 released! https://github.com/BlowbackDesign/EmailObfuscation/releases/tag/1.2.0 In this version only encryption key is stored in the emo object of html document and crypted email strings as data attributes to span elements that are used to replace found email addresses. This makes it possible to obfuscate emails generated within AJAX request. There is also a new option at module config to lock the encryption key so that it does not change on every session like it does by default. This is required if you are caching AJAX output for more than session lifetime. Otherwise this option is good leave disabled. Here is quick example of a simple AJAX request with obfuscated output: <?php namespace ProcessWire; if($config->ajax) { $str = "<p><a href='mailto:foo@bar.com'>Click to mail</a></p>"; // auto obfuscation works only when complete html document is rendered so you // need to do manual obfuscation on AJAX calls even when mode is set to auto echo $sanitizer->emo($str); return $this->halt(); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>EMO ajax example</title> </head> <body> <p>john@doe.com</p> <div id="result"></div> <p><button onclick="sendExample()">Show me some</button></p> <script> var sendExample = function() { var xhttp = new XMLHttpRequest(); xhttp.open("POST", "<?= $page->url ?>", true); xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhttp.onreadystatechange = function() { if(this.readyState == 4 && this.status == 200) { document.getElementById("result").innerHTML = xhttp.response; // run emo init when there's something new to digest emo.init(); } }; xhttp.send(); }; </script> </body> </html>
  7. Hello @gebeer! I made a convert to object literal on your supposal but it had issue when "JavaScript loading method" was set to:manual (where emo.js is loaded after the inline script block). So script init is now again attached to the window onload event and emo.js can be included at any part of page. Thanks for the report! I also dropped ProcessWire namespace for continued 2.x support, thanks for a remind @Robin S! That was maybe too hesitated and no requirements for it. Version bumped to 1.1.1 and it's available at GitHub: https://github.com/BlowbackDesign/EmailObfuscation/releases/tag/1.1.1 Besides bugfixes this version adds support to multilanguage nosript text and template cache.
  8. Thanks for the info! Yeah, I've noticed this module before but I feel the same with Soma here that this should be something that's already implemented as a core feature. The idea of scattered sorting settings between template and module config seems bit complicated in a long run.
  9. +1 for this feature! Maybe there could be a simple "custom selector" option in the dropdown with added text field.
  10. Hi all! Sorry I'm little late for the party. Key validation on every page load is surely not necessary and it was just a simple stupidity be set like that. It's fixed now and I just pushed it to github. Thanks for the notice! (not been using the module after couple of tryouts)
  11. Hello! Yes, I think something like this on your page template should work. $page->addHookBefore('render', function($event) { if(wire('input')->get->myvar) { $emo = wire('modules')->get('EmailObfuscation'); $emo->mode = $emo::modeManual; } });
  12. Hello @Zeka! Sorry for massive delay but I just quickly tested EMO with built-in cache and was able to repeat yor issue. Cache file had emails as plain text and both EMO scripts were missing. On a public page it was still allright (emails obfuscated) so I don't know why it wasn't really using cached version? Switch to ProCache worked as excepted - cached page, which was obfuscated. I'm really lost with PW built-in cache since I'm so used to work with Ryans ProCache module and it has never had any issues running together with EMO. So for now my best bet for you is to get that - in a meantime we'll see if there is something we can about this. Multilanguage support is already in my TODO list, if I just could find the time... Thanks for the notice!
  13. You can do this with EMO too: At module settings page set "Obfuscation mode" to "Obfuscate manually..." (OR adjust exclude/include templates/pages settings to have auto obfuscation enabled only where needed). Then on a page template obfuscate only the parts of markup you want by using $sanitizer->emo() method. // obfuscate single email address echo $sanitizer->emo('hello@world.com'); // obfuscate email addresses from a body field output echo $sanitizer->emo($page->body); Also make sure that you are using the 1.1.x version since this feature was added to the latest release (1.1.0).
  14. You can compress up to 500 images per month for free with TinyPNG API: https://tinypng.com/developers
  15. To be honest, I've missed the whole world of conditional autoloading of PW modules... Dropping off support for 2.2 isn't any issue. There will be older perfecly functional emo releases available if someone needs it. So I think I'll go ahead and make this change same time I'll add PW namespace to the module - which should happen pretty soon. Thanks for the notice!
×
×
  • Create New...