You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my plugin, I'm using UPLOAD_ERR_OK !== $_FILES['form-field-name']['error'] to check for issues with file uploads (from an <input type="file" name="form-field-name" /> in this example).
Good find @TobiasBg! It sounds like php_register_variable_ex would be a better choice as it accepts a zval instead of a char. This is what PHP does (through a few layers of indirection):
Removes the custom file upload handler and rely on PHP body parsing
to populate the $_FILES array. Instead of encoding the body bytes as
a string, parsing that string, and re-encoding it as bytes, we keep
the body in a binary form and pass it directly to PHP HEAP memory.
Closes#997Closes#1006Closes#914
## Testing instructions
Confirm the CI checks pass (it will take a few iterations to get them right I'm sure :D)
In my plugin, I'm using
UPLOAD_ERR_OK !== $_FILES['form-field-name']['error']
to check for issues with file uploads (from an<input type="file" name="form-field-name" />
in this example).The
UPLOAD_ERR_OK
constant in PHP normally is anint
, see https://3v4l.org/WjW2j .However, in WordPress Playground,
$_FILES['form-field-name']['error']
returns astring
.Maybe something in
wordpress-playground/packages/php-wasm/compile/php/php_wasm.c
Line 1184 in 57ef882
The text was updated successfully, but these errors were encountered: