Changeset 1924669
- Timestamp:
- 08/14/2018 01:51:49 PM (7 years ago)
- Location:
- emailscrambler
- Files:
-
- 6 added
- 1 deleted
- 5 edited
- 2 copied
-
tags/1.1 (added)
-
tags/1.1/classes (added)
-
tags/1.1/classes/action.class.php (added)
-
tags/1.1/classes/wpes.class.php (added)
-
tags/1.1/emailscrambler.php (copied) (copied from emailscrambler/trunk/emailscrambler.php) (1 diff)
-
tags/1.1/js (added)
-
tags/1.1/js/emailprotection.js (added)
-
tags/1.1/readme.txt (copied) (copied from emailscrambler/trunk/readme.txt) (2 diffs)
-
trunk/classes/action.class.php (modified) (1 diff)
-
trunk/classes/ds.class.php (deleted)
-
trunk/classes/wpes.class.php (modified) (3 diffs)
-
trunk/emailscrambler.php (modified) (1 diff)
-
trunk/js/emailprotection.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
emailscrambler/tags/1.1/emailscrambler.php
r1924655 r1924669 17 17 namespace wpes; 18 18 19 require_once dirname(__FILE__).'/classes/ds.class.php';20 19 require_once dirname(__FILE__).'/classes/wpes.class.php'; 21 20 require_once dirname(__FILE__).'/classes/action.class.php'; 22 21 23 foreach (array('the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt') as $filter) 24 { 22 foreach (array('the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt') as $filter) { 25 23 26 24 add_filter($filter, array('\wpes\wpes', 'filter'), 1000); -
emailscrambler/tags/1.1/readme.txt
r1924655 r1924669 4 4 Tags: antispam,spam,email,protection,encrypt 5 5 Requires at least: 3.0.1 6 Tested up to: 4.97 Stable tag: 1. 06 Tested up to: 5.0 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 = 1.0 = 25 25 * Initial release 26 27 = 1.1 = 28 * Compatible with Gutenberg 29 * No replacement of input value fields -
emailscrambler/trunk/classes/action.class.php
r1696481 r1924669 9 9 namespace wpes; 10 10 11 abstract class action 12 { 11 abstract class Action { 13 12 14 public static function wp_enqueue_scripts() 15 { 13 public static function wp_enqueue_scripts() { 16 14 17 15 wp_enqueue_script('wpes_js', plugins_url('emailscrambler/js/emailprotection.js')); -
emailscrambler/trunk/classes/wpes.class.php
r1696481 r1924669 10 10 namespace wpes; 11 11 12 class wpes 13 { 12 abstract class Wpes { 14 13 15 public static function MailEncrypt($string, $back = 0, $method = 1) 16 { 14 public static function MailEncrypt($string, $back = 0, $method = 1) { 17 15 18 16 $out = ''; 19 17 20 if ($method === 'ascii') 21 { 18 if ($method === 'ascii') { 22 19 23 for ($a = 0; $a < strlen($string); $a ++) 24 { 20 for ($a = 0; $a < strlen($string); $a ++) { 25 21 26 22 $out .= '&#'.ord(substr($string, $a, 1)).';'; … … 28 24 } 29 25 30 } 31 else 32 { 26 } else { 33 27 34 for ($a = 0; $a <strlen($string); $a ++) 35 { 28 for ($a = 0; $a <strlen($string); $a ++) { 36 29 37 30 $charValue = ord(substr($string,$a,1)); … … 48 41 } // public function MailEncrypt($string, $back = 0, $method = 1) 49 42 50 public static function match($match) 51 { 43 public static function match($match) { 52 44 53 if (preg_match('/^mailto:/i', $match[0])) 54 { 45 if (preg_match('/^mailto:/i', $match[0])) { 55 46 56 47 return 'javascript:wpes_linkTo_UnCryptMailto(\''.self::MailEncrypt(preg_replace('/^mailto:/i', '', $match[0])).'\');'; 57 48 58 } 59 else 60 { 49 } else if (!preg_match('/^value/i', $match[0])) { 61 50 62 51 return preg_replace('/@/', '(at)', $match[0]); 63 52 64 } 53 } else return $match[0]; 65 54 66 55 } // function match($match) 67 56 68 public static function filter($string) 69 { 57 public static function filter($string) { 70 58 71 59 if (strpos($string, '@') === false) return $string; 72 60 73 $regexp = '/(?:mailto:)?(?:[-!#$%&*+\/=?^_`.{|}~\w\x80-\xFF]+|".*?")\@(?:[-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+|\[[\d.a-fA-F:]+\])/xi'; 61 $regexp = '/(?:value=(\"|\'))?(?:mailto:)?(?:[-!#$%&*+\/=?^_`.{|}~\w\x80-\xFF]+|".*?")\@(?:[-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+|\[[\d.a-fA-F:]+\])/xi'; 62 //$regexp = '/(?:mailto:)?(?:[-!#$%&*+\/=?^_`.{|}~\w\x80-\xFF]+|".*?")\@(?:[-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+|\[[\d.a-fA-F:]+\])/xi'; 74 63 75 64 return preg_replace_callback($regexp, array('wpes\wpes', 'match'), $string); -
emailscrambler/trunk/emailscrambler.php
r1696481 r1924669 17 17 namespace wpes; 18 18 19 require_once dirname(__FILE__).'/classes/ds.class.php';20 19 require_once dirname(__FILE__).'/classes/wpes.class.php'; 21 20 require_once dirname(__FILE__).'/classes/action.class.php'; 22 21 23 foreach (array('the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt') as $filter) 24 { 22 foreach (array('the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt') as $filter) { 25 23 26 24 add_filter($filter, array('\wpes\wpes', 'filter'), 1000); -
emailscrambler/trunk/js/emailprotection.js
r1696481 r1924669 1 1 2 function wpes_UnCryptMailto(s) 3 { 2 function wpes_UnCryptMailto(s) { 4 3 5 4 var n=0; 6 5 var r=""; 7 6 8 for (var i=0; i < s.length; i++) 9 { 7 for (var i=0; i < s.length; i++) { 10 8 11 9 n=s.charCodeAt(i); … … 20 18 } 21 19 22 function wpes_linkTo_UnCryptMailto(s) 23 { 20 function wpes_linkTo_UnCryptMailto(s) { 24 21 25 22 location.href = 'mailto:' + wpes_UnCryptMailto(s); -
emailscrambler/trunk/readme.txt
r1696643 r1924669 4 4 Tags: antispam,spam,email,protection,encrypt 5 5 Requires at least: 3.0.1 6 Tested up to: 4.97 Stable tag: 1. 06 Tested up to: 5.0 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 = 1.0 = 25 25 * Initial release 26 27 = 1.1 = 28 * Compatible with Gutenberg 29 * No replacement of input value fields
Note: See TracChangeset
for help on using the changeset viewer.