开发者 |
kirkpatrick
Joe d'Andrea sassymonkey capnhairdo luckyduck288 |
---|---|
更新时间 | 2011年4月5日 00:06 |
PHP版本: | 2.8 及以上 |
WordPress版本: | 3.1 |
<a href="mailto:you@example.com">Real Name</a>
), allowing class and style attributes (but ignoring other attributes), and allowing an email Subject using the syntax mailto:you@example.com?subject=...
.[EMAIL Real Name | you@example.com]
, also allowing the ?subject=... ]
syntax. (Earlier versions' much more fragile [Real Name] you@example.com
remains available if LEGACY is chosen.)you@example.com
, with or without "mailto:" in front of it. (?subject=
syntax not allowed here.)you [@] example [.] com
, where the [@] and [.] are either text symbols or graphic images (as set in administration), hiding the email addresses from spambots.
If JavaScript is not enabled, the email will appear in obfuscated but human-readable form but the link will not be active.
The email addresses occur in the HTML source only in a well-hidden encoding. The email address is converted to hexadecimal and appears only as the value of a JavaScript variable. That encoded email is separated in the JavaScript from the telltale mailto:
to further confuse spambots.
I believe any legitimate email will be recognized. However, no attempt at validation is made -- certain illegally formed addresses will also be recognized, for example, ones containing two successive .'s. (Note: Legal characters before the @ are !#$%&'*+/=?^_{|}~- and `.)
I've designed this plug-in with "real name" emails in mind -- <a href="mailto:you@example.com">Real Name</a>
or [EMAIL Real Name | you@example.com]
, which display as Real Name
. This will follow whatever styling you apply to your text and to links. However, if you primarily obfuscate lists of bare email addresses -- you@example.com
-- you may not be satisfied with the appearance. They will appear with either glyphs or specified text symbols in place of @
and .
. The color and weights of the glyphs are fixed (though they do change size with surrounding text), and they don't look exactly like the font symbols they replace. And if text symbols are used, they certainly don't look exactly like @
and .
.
GLYPHS=true
) no longer causes xhtml validation errors. ?subject=
syntax allowed in [EMAIL | ]
form.
1.4
2010/03/09 Bugfix: now correctly allows extended email syntax "email?subject=yyy". Bugfix: now correctly allows extra spaces within shortcode [EMAIL | ]. Email link may exhibit email: <a href="mailto:aa@bb.cc">aa@bb.cc</a>
; the exhibited email will be obfuscated.
1.3
2010/01/27 Fixed problem causing link not to be displayed -- may occur under PHP 5.2.6 and older (due to the named-subpattern bug in preg_replace_callback). Added "easy to write" email tag [EMAIL Name | A@B.C]
. Conversion of an email anchor allows (but ignores) other attributes besides href, and allows extended mailto: syntax (eg, ?subject=...). Introduced BARE_TO_LINK
choice. Changed default textifying characters from dashes to hook and comma. Cleaned up code, JavaScript.
1.2
2009/11/19 Fixed repeat email bug: correctly treats identical repeat emails (of all types). Now converts emails placed in text widgets (requires WP 2.3). Fixed problem with multiple spaces in the special form [name] a@b.cc . Introduced CLICKPOP
.
1.1
2009/11/18 Fixed problem with operation in comments.\
1.0
2009/11/16