[buddypress-trac] [BuddyPress Trac] #8125: func_get_args() should be cast to variable before being modified

buddypress-trac noreply at wordpress.org
Thu Aug 8 20:11:53 UTC 2019


#8125: func_get_args() should be cast to variable before being modified
--------------------------+---------------------------
 Reporter:  boonebgorges  |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  5.0.0
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+---------------------------
Changes (by boonebgorges):

 * owner:  (none) => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"12426" 12426]:
 {{{
 #!CommitTicketReference repository="" revision="12426"
 Cast `func_get_args()` to variable early in class methods.

 Since PHP 7.0, calling `func_get_args()` returns the current value of
 the parameter, which may have been modified since the beginning of the
 method. By storing the original function arguments in a variable at the
 beginning of the method, we ensure that the value operated on later in
 the method accurately reflects what was originally passed.

 In most cases addressed by this changeset, there was no real-world
 possibility that the arguments could be changed; we make this change
 mostly as a best practice, and to appease the PHP compatibility linter.

 Fixes #8125.
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8125#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list