Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#8538 closed defect (bug) (fixed)

Error message when clicking in cancelled email verification link

Reported by: nunks's profile nunks Owned by: imath's profile imath
Milestone: 9.1.0 Priority: normal
Severity: normal Version: 9.0.0
Component: Settings Keywords: has-patch 2nd-opinion
Cc:

Description

Error message when clicking in cancelled email verification link:

BuddyPress version: 9.0.0
Wordpress version: 5.8

Steps to reproduce:

  1. Change e-mail address in profile page
  2. Cancel e-mail change in profile page
  3. Follow (now invalid) verification link sent to user email as confirmation

Error returned:

    Warning: Uninitialized string offset 0 in /srv/http/bp/wp-content/plugins/buddypress/bp-settings/actions/general.php on line 258

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /srv/http/bp/wp-content/plugins/buddypress/bp-settings/actions/general.php:258 Stack trace: #0 /srv/http/bp/wp-includes/class-wp-hook.php(303): bp_settings_verify_email_change() #1 /srv/http/bp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #2 /srv/http/bp/wp-includes/plugin.php(470): WP_Hook->do_action() #3 /srv/http/bp/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(368): do_action() #4 /srv/http/bp/wp-includes/class-wp-hook.php(303): bp_actions() #5 /srv/http/bp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #6 /srv/http/bp/wp-includes/plugin.php(470): WP_Hook->do_action() #7 /srv/http/bp/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(445): do_action() #8 /srv/http/bp/wp-includes/class-wp-hook.php(303): bp_template_redirect() #9 /srv/http/bp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #10 /srv/http/bp/wp-includes/plugin.php(470): WP_Hook->do_action() #11 /srv/http/bp/wp-includes/template-loader.php(13): do_action() #12 /srv/http/bp/wp-blog-header.php(19): require_once('/srv/http/bp/wp...') #13 /srv/http/bp/index.php(17): require('/srv/http/bp/wp...') #14 {main} thrown in /srv/http/bp/wp-content/plugins/buddypress/bp-settings/actions/general.php on line 258

The error occur even when BuddyPress is the only active plugin in installation.

Expected behavior: Maybe send user back to profile page? An action hook would be a nice extra...

Test installation run in: ArchLinux, Apache 2.4.48, PHP 8.0.8

Attachments (1)

8538.patch (3.5 KB) - added by imath 3 years ago.

Download all attachments as: .zip

Change History (5)

#1 @imath
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 9.1.0

Thanks for your report. I'll look at it asap.

@imath
3 years ago

#2 @imath
3 years ago

  • Keywords has-patch 2nd-opinion added; needs-patch removed

8538.patch should fix the issue. It includes hooks to bypass the redirect when this case happens, when the email has been changed and when the email change has been dismissed.

About the feedback message output to the user who followed an invalid verification link, as english is not my native language, don't hesitate to improve it:
"There was a problem verifying your new email address. If you haven’t dismissed the pending email change, please request a new email update."

Last edited 3 years ago by imath (previous) (diff)

#3 @imath
3 years ago

In 13043:

Settings: do not try to validate a dismissed email change

If a user clicks on the link to verify and validate an email change he previously dismissed, we need to show him an error feedback instead of trying (and failing) to validate a dismissed email change.

Doing so is also avoiding errors with PHP8.

Props nunks

See #8538 (trunk)

#4 @imath
3 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13044:

Settings: do not try to validate a dismissed email change

If a user clicks on the link to verify and validate an email change he previously dismissed, we need to show him an error feedback instead of trying (and failing) to validate a dismissed email change.

Doing so is also avoiding errors with PHP8.

Props nunks

Fixes #8538 (branch 9.0)

Note: See TracTickets for help on using tickets.