WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#16053 closed defect (bug) (fixed)

Back to Authors and Users link redirects to the wrong screen

Reported by: PeteMall Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Network Admin Keywords: has-patch commit
Focuses: multisite Cc:

Description

When you edit a user from network admin site-users screen, the "← Back to Authors and Users" link redirects the user to the network/users.php instead of network/site-users.php?id=x

Attachments (4)

16053.diff (1.6 KB) - added by PeteMall 3 years ago.
16053.2.diff (1.6 KB) - added by PeteMall 3 years ago.
16053.3.diff (2.5 KB) - added by SergeyBiryukov 3 years ago.
16053.4.diff (2.9 KB) - added by nacin 3 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 SergeyBiryukov3 years ago

Also, after editing a user on network/users.php the referer is empty:

/wp-admin/network/user-edit.php?user_id=4&updated=true&wp_http_referer

PeteMall3 years ago

PeteMall3 years ago

comment:2 garyc403 years ago

  • Keywords has-patch needs-testing added

SergeyBiryukov3 years ago

comment:3 SergeyBiryukov3 years ago

Fixed empty referer.

comment:4 nacin3 years ago

Looks good.

nacin3 years ago

comment:5 nacin3 years ago

  • Keywords commit added; needs-testing removed

Final patch works for me. Modified the URL generation a bit -- network_admin_url() and full esc_url() -- and in user-edit, we're now only adding the wp_http_referer argument if there is one, preventing a URL that looks like:

user-edit.php?user_id=2&updated=true&wp_http_referer

Tested every way possible. Offering commit.

comment:6 nacin3 years ago

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

(In [17201]) Allow us to return from whence we came. Specify wp_http_referer for user-edit in the network admin, as we may come from network/users or site-users. props PeteMall, SergeyBiryukov, fixes #16053.

Note: See TracTickets for help on using tickets.