• In my wordpress blog, I wanted to also protect phone numbers from being harvested. So I extended the email_protect plugin with a new function that lets me protect arbitrary text.

    Question to the developer (John Kolbert):
    Can you include my patch into the official version of your plugin? It’s just one additional function to be added to the emailprotect.php file.

    function ep_text_protect($content){  //converts arbitrary text to an image
        // note that this function converts the whole text to a single image.
        // all text is written on one line.
    	$options = get_option('se_options_insert');
    
        if (preg_match('/\W+/', $options['se_font'])){
              $options['se_font'] = 2;
            }
        if (preg_match('/\W+/', $options['se_bgcolor'])) {
              $options['se_bgcolor'] = "000000";
            }
        if (preg_match('/\W+/', $options['se_ftcolor'])) {
              $options['se_ftcolor'] = "ffffff";
            }
        if (preg_match('/\W+/', $options['se_bdcolor'])) {
              $options['se_bdcolor'] = "000000";
            }
    
        $plugin_path = get_bloginfo('wpurl') . '/wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/';
    
        $encrypt_text = base64_encode($content);
        $content = "<img src=\"{$plugin_path}image.php?id={$encrypt_text}&font={$options['se_font']}&bg={$options['se_bgcolor']}&ft={$options['se_ftcolor']}&bd={$options['se_bdcolor']}\"/>";
        return $content;
    }

    http://wordpress.org/extend/plugins/email-protect/

The topic ‘[Plugin: Email Protect] Protecting arbitrary text (suggested improvement and patch)’ is closed to new replies.