Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39200 closed enhancement (fixed)

Replace `is_super_admin()` check with current_user_can( 'manage_network_options' ) in wp-admin/options.php

Reported by: sathyapulse Owned by: flixos90
Priority: normal Milestone: 4.8
Component: Role/Capability Version:
Severity: normal Keywords: has-patch
Cc: Focuses: multisite

Description

This is part of the #37616 task. There are 2 is_super_admin() checks in wp-includes/option.php that should be replaced with current_user_can( 'manage_network' ).

See: https://core.trac.wordpress.org/ticket/37616#comment:26

Attachments (3)

39200.patch​ (954 bytes ) - added by sathyapulse 10 years ago.
39200.1.patch​ (4.1 KB ) - added by sathyapulse 10 years ago.
39200.2.patch​ (1011 bytes ) - added by sathyapulse 10 years ago.

Download all attachments as: .zip

Change History (9)

@sathyapulse
10 years ago

#1 @flixos90
10 years ago

  • Focuses multisite added
  • Keywords has-patch added
  • Milestone Awaiting Review → 4.8
  • Owner set to flixos90
  • Status new → assigned
  • Type defect (bug) → enhancement

Hi @sathyapulse, and thanks for the patch! It looks good so far. One minor thing we could adjust is to add curly braces around the clause in line 163: Since we are changing the line anyway, it's a good habit to adjust this clause to follow the proper coding standards.

Feel free to update your patch accordingly, that would be great! :)

#2 @sathyapulse
10 years ago

Hi @flixos90,

Thank you for the suggestion. I should have noticed that earlier. I have attached the new patch file which includes the missing curly braces throughout the file. Please let me know if any other changes need to be done in the file. I am happy to do it.

#3 @flixos90
10 years ago

  • Keywords needs-refresh added
  • Status assigned → reviewing

Thanks for the update @sathyapulse.

I think we had a small misunderstanding here, the code format should only be adjusted in lines (or their direct environment) which are changed anyway. In 39200.1.patch​ you added curly braces throughout the entire file, but this makes the diff unreadable since it's unclear what the actual functional code change was.
Only the one clause that you changed in 39200.patch​ line 163 should get curly braces, please ignore the other ones. Could you please update the patch? It's probably easiest if you do it based on your initial patch.

#4 @sathyapulse
10 years ago

@flixos90 Sorry, the patch is updated as per your request.

Last edited 10 years ago by sathyapulse (previous) (diff)

#5 @flixos90
10 years ago

  • Keywords needs-refresh removed

Perfect, thanks a lot @sathyapulse!

#6 @flixos90
10 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 39933:

Multisite: Replace is_super_admin() with manage_network_options in wp-admin/options.php.

Props sathyapulse.
Fixes #39200. See #37616.

Note: See TracTickets for help on using tickets.