Merge lp:~jacekn/wordpress/wp-plugin-openid-bugfix into lp:~canonical-sysadmins/wordpress/wp-plugin-openid

Proposed by Jacek Nykis
Status: Merged
Merged at revision: 3
Proposed branch: lp:~jacekn/wordpress/wp-plugin-openid-bugfix
Merge into: lp:~canonical-sysadmins/wordpress/wp-plugin-openid
Diff against target: 14 lines (+3/-1)
1 file modified
comments.php (+3/-1)
To merge this branch: bzr merge lp:~jacekn/wordpress/wp-plugin-openid-bugfix
Reviewer Review Type Date Requested Status
Neale Pickett (community) Approve
Review via email: mp+283178@code.launchpad.net

Description of the change

Fix bug where non registered users can't post comments even if with "comment_registration" set to false

RT#87997

To post a comment you must log in.
Revision history for this message
Neale Pickett (neale) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'comments.php'
2--- comments.php 2015-10-27 23:57:56 +0000
3+++ comments.php 2016-01-19 16:42:25 +0000
4@@ -101,7 +101,9 @@
5 $user = wp_get_current_user();
6 global $comment_author, $comment_author_email;
7
8- if ( get_option('require_name_email') && !$user->ID ) {
9+ // Only verify data if we require registration for comments
10+ // othwerwise we rely on built in check sanity checks
11+ if ( get_option( 'comment_registration' ) && get_option('require_name_email') && !$user->ID ) {
12 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) {
13 wp_die( __('Error: please fill the required fields (name, email).', 'openid') );
14 } elseif ( !is_email($comment_author_email)) {

Subscribers

People subscribed via source and target branches