[wp-trac] [WordPress Trac] #47678: Modernize/simplify current_user_can()

WordPress Trac noreply at wordpress.org
Sun Sep 15 12:15:55 UTC 2019


#47678: Modernize/simplify current_user_can()
-------------------------------------+-------------------------------------
 Reporter:  jrf                      |       Owner:  pento
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  5.3
Component:  Role/Capability          |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-unit-      |     Focuses:  performance, coding-
  tests commit needs-dev-note        |  standards
-------------------------------------+-------------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:32 jrf]:
 > Just checking in: what can I do to move this ticket forward ?
 >
 > The first 15 patches were committed (with one being reverted - see
 discussion above, this revert should probably be reconsidered). The other
 37(!) patches have had no action so far.

 Thank you for all the work on this!

 The commits above should cover everything except for
 [attachment:47678-do_action.patch], which causes a fatal error on older
 PHP versions:
 {{{
 Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in
 wp-includes/plugin.php on line 442
 }}}
 instead of displaying a proper error message:
 {{{
 Your server is running PHP version 5.2.17 but WordPress
 5.3-alpha-45282-src requires at least 5.6.20.
 }}}

 I think it's still preferable to show a proper error message on PHP < 5.6,
 at least until a switch to PHP 7.x is made.

 I'd like to remove this PHP 4 code though:
 {{{
 $args = array();
 if ( is_array( $arg ) && 1 == count( $arg ) && isset( $arg[0] ) &&
 is_object( $arg[0] ) ) { // array(&$this)
         $args[] =& $arg[0];
 } else {
         $args[] = $arg;
 }
 }}}


 1. Could you refresh the patch without changing the function signature for
 now?
 2. Could you create a new ticket for reconsidering the revert of [45624]?

 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47678#comment:58>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list