Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: UploadedFile::move() may return incorrect value #5302

Merged
merged 5 commits into from
Nov 23, 2021

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 10, 2021

Supersedes and closes #5290

Description

  • if move_uploaded_file() returns false without warning, move() and hasMoved() returns true

https://www.php.net/manual/en/function.move-uploaded-file.php#refsect1-function.move-uploaded-file-returnvalues
Return Values ¶

Returns true on success.

If from is not a valid upload file, then no action will occur, and move_uploaded_file() will return false.

If from is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return false. Additionally, a warning will be issued.

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 10, 2021
@kenjis kenjis force-pushed the fix-UploadedFile-hasMoved branch from 0ac61a1 to 27d216b Compare November 20, 2021 00:54
@kenjis kenjis requested a review from paulbalandan November 20, 2021 01:51
@kenjis kenjis merged commit d002547 into codeigniter4:develop Nov 23, 2021
@kenjis kenjis deleted the fix-UploadedFile-hasMoved branch November 23, 2021 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants