Jump to content

Recommended Posts

Posted

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

Posted
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
  • 6 months later...
Posted

@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?

Posted
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
  • 1 year later...
Posted

@Roope
It seems that it does not work with Chinese characters inside an <a> tag.

<a href="mailto:mail@website.com"><span>发送电子邮件</span></a>
// error console

page/:254 Uncaught URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at emo.decrypt (page/:254:558)
    at emo.replace (page/:254:382)
    at emo.init (page/:254:105)

 

  • 10 months later...
Posted

Hi @Roope,

thanks for this great module.

I found a markup issue in Email Obfuscation 1.3.1 (ProcessWire 3.x, PHP 8.1+) when an email link contains an aria-label attribute.

Reproduction
Input HTML:

<a href="mailto:mail@domain.de" class="uk-button uk-button-text" aria-label="Send email">mail@domain.de</a>


Output with EMO enabled:

<a href="mailto:<noscript data-emo="...">Enable JavaScript to view protected content.</noscript>" class="uk-button uk-button-text" aria-label="Send email"><noscript data-emo="...">Enable JavaScript to view protected content.</noscript></a>


Expected behavior: the whole <a ...>...</a> should be obfuscated/replaced as one unit, not inject <noscript> into the href attribute.

Suspected cause
In EmailObfuscation.module (obfuscate()), the skip pattern for label also matches aria-label, which seems to split the anchor tag before the mailto regex can process it as a full link.

As a temporary workaround, removing aria-label from mail links avoids the broken markup.

  • Like 1

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