Hi @aerin,
Not an expert in this area, but have you tried wp_upload_bits instead?
It may also be possible via _wp_handle_upload and wp_upload_dir() as per this stackexchange topic.
Thread Starter
Graham
(@aerin)
Thanks James. I have been looking wp_upload_bits and it may well be the solution.
But I’d still like to know why move_uploaded_file() is forbidden. It works and has been working since forever on other plugins I’ve submitted to the WP repository.
Security-wise,move_uploaded_file doesn’t really do much validation and people usually use it without any additional validation either. Then there are also reliability issues on certain filesystem setups with different permissions etc. For these reasons it’s always advisable to use the functions provided by WordPress for such things. Then you are on the safe side.
For specific questions about plugin submission, please ask in the #pluginreview Slack channel.
Thread Starter
Graham
(@aerin)
Thanks @swissspidy. The problem I have is I can’t find a suitable wordpress function.
I do a lot of validation on the uploaded data so I know it’s safe. I’d just like to clear the notice on the PCP report.