[wp-trac] [WordPress Trac] #37570: Parameter 1 to wp_handle_upload_error() expected to be a reference, value given

WordPress Trac noreply at wordpress.org
Tue Aug 9 21:55:05 UTC 2016


#37570: Parameter 1 to wp_handle_upload_error() expected to be a reference, value
given
--------------------------------------------+----------------------
 Reporter:  jbrinley                        |       Owner:  ocean90
     Type:  defect (bug)                    |      Status:  closed
 Priority:  normal                          |   Milestone:  4.6
Component:  Media                           |     Version:  trunk
 Severity:  normal                          |  Resolution:  fixed
 Keywords:  has-patch needs-testing commit  |     Focuses:
--------------------------------------------+----------------------

Comment (by ocean90):

 In [changeset:"38236"]:
 {{{
 #!CommitTicketReference repository="" revision="38236"
 Media: In `_wp_handle_upload()` use `call_user_func_array()` to call the
 upload error handler.

 The default error handler `wp_handle_upload_error()` expects a reference
 for the first parameter but `call_user_func()` doesn't pass parameters by
 reference. The current code didn't produce any issues until now. PHP 7.0.9
 (and PHP 7.1) is now stricter and prevents calling the error handler with
 a warning:
 > PHP Warning:  Parameter 1 to wp_handle_upload_error() expected to be a
 reference, value given.

 To restore the error handler `_wp_handle_upload()` now uses
 `call_user_func_array()`.

 Merge of [38235] to the 4.6 branch.

 Props jbrinley.
 Props jorbin for review.
 See #37570.
 }}}

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


More information about the wp-trac mailing list