Plugin Directory

Changeset 1924669


Ignore:
Timestamp:
08/14/2018 01:51:49 PM (7 years ago)
Author:
Daschmi
Message:
  • Release 1.1 =
  • Compatible with Gutenberg
  • No replacement of input value fields
Location:
emailscrambler
Files:
6 added
1 deleted
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • emailscrambler/tags/1.1/emailscrambler.php

    r1924655 r1924669  
    1717    namespace wpes;
    1818
    19     require_once dirname(__FILE__).'/classes/ds.class.php';
    2019    require_once dirname(__FILE__).'/classes/wpes.class.php';
    2120    require_once dirname(__FILE__).'/classes/action.class.php';
    2221
    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) {
    2523
    2624        add_filter($filter, array('\wpes\wpes', 'filter'), 1000);
  • emailscrambler/tags/1.1/readme.txt

    r1924655 r1924669  
    44Tags: antispam,spam,email,protection,encrypt
    55Requires at least: 3.0.1
    6 Tested up to: 4.9
    7 Stable tag: 1.0
     6Tested up to: 5.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424= 1.0 =
    2525* 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  
    99    namespace wpes;
    1010
    11     abstract class action
    12     {
     11    abstract class Action {
    1312
    14         public static function wp_enqueue_scripts()
    15         {
     13        public static function wp_enqueue_scripts() {
    1614
    1715            wp_enqueue_script('wpes_js', plugins_url('emailscrambler/js/emailprotection.js'));
  • emailscrambler/trunk/classes/wpes.class.php

    r1696481 r1924669  
    1010    namespace wpes;
    1111
    12     class wpes
    13     {
     12    abstract class Wpes {
    1413
    15         public static function MailEncrypt($string, $back = 0, $method = 1)
    16         {
     14        public static function MailEncrypt($string, $back = 0, $method = 1) {
    1715
    1816            $out = '';
    1917
    20             if ($method === 'ascii')
    21             {
     18            if ($method === 'ascii') {
    2219
    23                 for ($a = 0; $a < strlen($string); $a ++)
    24                 {
     20                for ($a = 0; $a < strlen($string); $a ++) {
    2521
    2622                    $out .= '&#'.ord(substr($string, $a, 1)).';';
     
    2824                }
    2925
    30             }
    31             else
    32             {
     26            } else {
    3327
    34                 for ($a = 0; $a <strlen($string); $a ++)
    35                 {
     28                for ($a = 0; $a <strlen($string); $a ++) {
    3629
    3730                    $charValue = ord(substr($string,$a,1));
     
    4841        } // public function MailEncrypt($string, $back = 0, $method = 1)
    4942
    50         public static function match($match)
    51         {
     43        public static function match($match) {
    5244
    53             if (preg_match('/^mailto:/i', $match[0]))
    54             {
     45            if (preg_match('/^mailto:/i', $match[0])) {
    5546
    5647                return 'javascript:wpes_linkTo_UnCryptMailto(\''.self::MailEncrypt(preg_replace('/^mailto:/i', '', $match[0])).'\');';
    5748
    58             }
    59             else
    60             {
     49            } else if (!preg_match('/^value/i', $match[0])) {
    6150
    6251                return preg_replace('/@/', '(at)', $match[0]);
    6352
    64             }
     53            } else return $match[0];
    6554
    6655        } // function match($match)
    6756
    68         public static function filter($string)
    69         {
     57        public static function filter($string) {
    7058
    7159            if (strpos($string, '@') === false) return $string;
    7260
    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';
    7463
    7564            return preg_replace_callback($regexp, array('wpes\wpes', 'match'), $string);
  • emailscrambler/trunk/emailscrambler.php

    r1696481 r1924669  
    1717    namespace wpes;
    1818
    19     require_once dirname(__FILE__).'/classes/ds.class.php';
    2019    require_once dirname(__FILE__).'/classes/wpes.class.php';
    2120    require_once dirname(__FILE__).'/classes/action.class.php';
    2221
    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) {
    2523
    2624        add_filter($filter, array('\wpes\wpes', 'filter'), 1000);
  • emailscrambler/trunk/js/emailprotection.js

    r1696481 r1924669  
    11
    2     function wpes_UnCryptMailto(s)
    3     {
     2    function wpes_UnCryptMailto(s) {
    43
    54        var n=0;
    65        var r="";
    76
    8         for (var i=0; i < s.length; i++)
    9         {
     7        for (var i=0; i < s.length; i++) {
    108
    119            n=s.charCodeAt(i);
     
    2018    }
    2119
    22     function wpes_linkTo_UnCryptMailto(s)
    23     {
     20    function wpes_linkTo_UnCryptMailto(s) {
    2421
    2522        location.href = 'mailto:' + wpes_UnCryptMailto(s);
  • emailscrambler/trunk/readme.txt

    r1696643 r1924669  
    44Tags: antispam,spam,email,protection,encrypt
    55Requires at least: 3.0.1
    6 Tested up to: 4.9
    7 Stable tag: 1.0
     6Tested up to: 5.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424= 1.0 =
    2525* 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.