Jump to content

Roope

Members
  • Posts

    212
  • Joined

  • Last visited

Posts posted by Roope

  1. On 1/24/2024 at 3:52 PM, Stefanowitsch said:

    @Roope I am using this module on PHP 8.1.2 and just received this error message:

    PHP Deprecated: Implicit conversion from float 521638.00000000006 to int loses precision in /home/users/xxx/site/modules/EmailObfuscation/EmailObfuscation.module:211

    The module seems to work normally though. Is this something to be concerned about?

    No need be concerned but thanks for the notice, I pushed a fix for this.

    https://github.com/BlowbackAgency/EmailObfuscation/commit/8dd2a3c278b86a36329122aac5d9ef0db7875218

    • Thanks 1
  2. 11 hours ago, patrick said:

    Hi Roope

    First of all, thanks so much for this great module!

    Just tested your latest release (v1.3.0 Stable) and got the following error (on PHP 8.1):
    Uncaught TypeError: Unsupported operand types: int + string in /site/modules/EmailObfuscation/EmailObfuscation.module:444

    Fixed

    • Like 1
  3. Hello all!

    An sorry for lousy support with this module - I'll try to be more supportive in the future.

    First af all.. I haven't made move to PHP8 yet since my whole web development work has been on slow burn for a year or so but things are moving forward and I'm getting back in track and also need to start moving my customer sites to PHP8 based server.

    So for starters I put up my dev stack with PW 3.0.210 and noticed that it requires at least PHP 8.1 to function properly. I installed PHP 8.1.10 and emo seems to work there as is with no problems so am I missing something? My error_reporting = E_ALL so I should get all warnings.

    • Thanks 1
  4. Hi all!

    Just dropped in to say that this module is not abandoned. I’ve been super busy with my paying projects and also in personal life at the moment so I haven’t found time to fix current issues.

    If @patman or someone else is willing to push PRs or even to make full rewrite I’m happy to pull them in. Current issues are easy to fix tho but unfortunately my time is VERY limited for the rest of the year. 

    • Like 1
  5. Hello @Robin S - and thanks for your efforts!

    I've optimized the auto init a bit so that it kicks in earlier and now it is in the line with 1.1 version. Or actually it is slightly faster and FOUC is almost unvisible.

    I also implemented the other two suggestions that you had: Wrapped replace text to noscript tag instead of span that prevents FOUC completely. Also added version number to JS autoload filename as a query string.

    While I was there I replaced skipped form tag with individual form elements and also added couple of attributes to the mix. Now obfuscation is skipped in following:

    Tags: head, script, textarea, option, output, input
    Attributes: value, label, data

    Version 1.2.4 is available at Github:

    https://github.com/BlowbackDesign/EmailObfuscation/releases/tag/1.2.4

    • Like 1
  6. On 4/17/2020 at 1:25 AM, Robin S said:

    It's valid to use inputs, textareas, etc outside of a form element.

    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.

    • Like 3
  7. 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.

    • Like 1
  8. 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!

    • Like 2
  9. On 2/25/2020 at 5:10 AM, grimezy said:

    Just a warning, this seems to have a conflict with SEO Maestro module?  I can't diagnose much as I'm at work and it's very busy at the moment.  Can anyone else confirm this?

    Thanks.

    I can't confirm.

    Running PW 3.0.123 + latest versions on both of modules.

    What kind of issues are you facing?

  10. 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>

     

    • Like 4
  11. 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.

    • Like 2
  12. 55 minutes ago, LostKobrakai said:

    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.

  13. On 8/9/2017 at 8:49 AM, adrian said:

    Seems like the main problem is that the setKeyAndValidate() method is called on every PW ready(). I just commented that out and load times go back to being normal.

    I don't know the Tiny API, but I would think it would be possible to either just do this once, the first time the API key is entered, or perhaps if it's needed for each call to Tiny, then it could be called only when one of the hooks is triggered.

    Perhaps @Roope can take a better look since it's his module.

     

    On 8/9/2017 at 11:21 AM, Gideon So said:

    Hi Adrian,

    Thanks for the fast investigation into the problem. 

    This is from their document:

    But I don't think it is not necessary to check the key every page load.

    Gideon

     

    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)

    • Like 2
  14. 9 hours ago, Robin S said:

    Hi @Roope,

    Love this module - it's used in all my sites. Is it possible to disable the module on some pages via a hook? I need to disable the obfuscation when a particular GET variable is present.

    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;
      }
    });

     

    • Like 1
  15. On 3/23/2017 at 7:15 PM, Zeka said:

    Hi @Roope

    Looks like module doesn't work when template cache is on. 

    It loads 

    
     var emo_addr = new Array();
     emo_addr[0] = "fA1PLjJh83r7WD9s+apZEH5RTFM0uYwS2Ge6bxVOktKvIndQC4qBUycoim.NlXgz";
     emo_addr[1] = "sJL2Tc4GuoWX8VHn0yXx05jt0182Mh3xF6Ue05jt0haQ9VxdFVXfFRxxTO3QYoWdTcXn7OHG86mt0VFQ+JHmF53q0oYB7VDQ0pmyTZCQTZif";
     if(window.addLoadEvent) addLoadEvent(emo_replace());

    just for first time after cache timeout, but cache is saved without it.

    Can somebody confirm it? 

    And one small feature request: could you change "Replate text string" input from text to text Multilanguage field.

    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!

    • Like 1
  16. 11 hours ago, ottogal said:

    Hi @Macrura,

    would you mind to reveal more details of your obfuscation function? I would highly appreciate it.

    You can do this with EMO too:

    1. 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).
    2. 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).

    • Like 1
  17. On 1/13/2017 at 9:34 AM, tpr said:

    The module is set to "autoload' => true, is this surely needed? In my quick test 'autoload' => 'template!=admin' works too.

     

    On 1/13/2017 at 11:27 AM, teppo said:

    This module was launched before 2.3.1, which introduced conditional autoloading. Aforementioned change seems reasonable, but means dropping support for 2.2.

    ... although dropping support for 2.2 at this point doesn't seem like such a huge issue ;)

     

    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!

     

    • Like 2
×
×
  • Create New...