[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:53:15 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:
--------------------------------------------+----------------------
Changes (by ocean90):
* status: accepted => closed
* resolution: => fixed
Comment:
In [changeset:"38235"]:
{{{
#!CommitTicketReference repository="" revision="38235"
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()`.
Props jbrinley.
Props jorbin for review.
Fixes #37570.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37570#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list