This post is now out of date. If you’re having trouble with the Subscribe to Comments plugin with WP 2.1 make sure you have v2.1 of the plugin as well.
I recently upgraded to WordPress 2.1 and ran into a bug with my Subscribe to Comments plugin. The latest release of this plugin as of this writing is 2.0.8. The bug that I ran into was when I would try to comment I’d get this error:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in LOCAL ADDRESS/wp-content/plugins/subscribe-to-comments.php on line 438
Warning: Cannot modify header information – headers already sent by (output started at LOCAL ADDRESS/wp-content/plugins/subscribe-to-comments.php:438) in LOCAL ADDRESS/wp-includes/pluggable.php on line 275
I previously had a fix posted here but removed it as Ronald Heft pointed out a better, more correct fix. You open up the subscribe-to-comments.php file, go to line 438 and change what’s there to this:
$previously_subscribed = ( $wpdb->get_var("SELECT comment_subscribe from $wpdb->comments WHERE comment_post_ID = '$postid' AND LCASE(comment_author_email) = '$email' AND comment_subscribe = 'Y' LIMIT 1") || in_array(stripslashes($email), array(get_post_meta($postid, '_sg_subscribe-to-comments'))) ) ? true : false;
Thanks Ronald!






One Trackback
[...] When upgrading, activate your plugins one by one and go check your blog to see if everything is working smoothly. Some plugins might have some issues with this new version. One of such is the famous Subscribe to comments plugins but thanks to Ben Gray of Openswitch.org who found a quick fix to that. [...]