osompress / simple-social-icons

Plugin: Simple Social Icons
62 stars 33 forks source link

Obfuscate email address when entered with mailto prefix #73

Open nickcernis opened 6 years ago

nickcernis commented 6 years ago

In https://github.com/studiopress/simple-social-icons/pull/61 we obfuscated email addresses.

That's working when addresses are entered as literal addresses (test@example.com), but not when prefixed with (mailto:test@example.com): https://wordpress.org/support/topic/email-address-isnt-encoded/#post-10607846

We could adapt the test at https://github.com/studiopress/simple-social-icons/pull/61/files#diff-12a1b54f83ab74a5deb89c7b9c8cc7eeL394 to first strip 'mailto:' from the string before testing for an email address (and also apply antispambot only to the email portion if mailto is present).