|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-07-27 15:48 UTC] cmb@php.net
[2021-08-18 11:10 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2021-08-18 11:10 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 05:00:01 2025 UTC |
Description: ------------ PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS ) When using `move_uploaded_file` with a stream wrapper url as destination, the return value of the method `stream_flush` is ignored. The function `move_uploaded_file` always returns true, even if `stream_flush` returns false. Test script: --------------- class MyStreamWrapper { ... public function stream_write($data) { return 1; } public function stream_flush() { return false; } ... } stream_wrapper_register('my-wrapper', \MyStreamWrapper::class, 0); $res = move_uploaded_file($_FILES['uploaded_file']['tmp_name'], 'my-wrapper://' . basename($_FILES['uploaded_file']['name'])); stream_wrapper_unregister('my-wrapper'); echo $res ? 'true' : 'false'; Expected result: ---------------- false Actual result: -------------- true