Title: PHP error
Last modified: September 2, 2016

---

# PHP error

 *  [David R. Woolley](https://wordpress.org/support/users/drwool/)
 * (@drwool)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/php-error-25/)
 * Nice little plugin, but it generates a PHP error if you have error reporting 
   enabled in your wp-config file. The error is an undefined index, which occurs
   unless when you use the shortcode you include both “mail” and “mailto” arguments(
   with one of them blank.)
 * You can fix this easily enough by rewriting the plugin to use “isset” to check
   for the existence of each index before trying to reference it, like so:
 * _[ Moderator Note: Please post code or markup snippets between backticks or use
   the code button. ]_
 *     ```
       function wk_email_antibot_shortcode($args)
       {
         ob_start();
         if (isset($args["mail"]))
         {
           echo antispambot($args["mail"]);
         }
         if (isset($args["mailto"]))
         {
           echo '<a>'.antispambot($args["mailto"]).'</a>';
         }
         $output_string = ob_get_contents();
         ob_end_clean();
         return $output_string;
       };
       add_shortcode('antibot', 'wk_email_antibot_shortcode');
       ```
   

The topic ‘PHP error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wk-email-antibot.svg)
 * [wk-email-antibot](https://wordpress.org/plugins/wk-email-antibot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wk-email-antibot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wk-email-antibot/)
 * [Active Topics](https://wordpress.org/support/plugin/wk-email-antibot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wk-email-antibot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wk-email-antibot/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [David R. Woolley](https://wordpress.org/support/users/drwool/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/php-error-25/)