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
When a file is not uploaded in a form, an empty FileUpload with uninitialized properties is returned to the Presenter. Once the data is processed by underlying code, by calling the __toString() method on the object, which is typed as returning string, it will, based on version, either end on null returned, expected string, or $tmpName must not be accessed before initialization
Expected Behavior
The method that should return a string returns a string.
Possible Solution
Initialize the properties of FileUpload with values, namely $tmpName with empty string
Alternatively make the properties nullable and initialize with nulls
Cast the $tmpName to string in the toString method so that no error is thrown.
Happy to prepare a PR once I know what the preferred solution is.
The text was updated successfully, but these errors were encountered:
The uninitialized FileUpload is completely stupid. I've had it in my TODO for like five years, so if you could fix the whole thing, that would be really cool. Or at least the __toString(). Which way to solve it probably doesn't matter.
Version: 3.2.4, 3.3.0
Bug Description
When a file is not uploaded in a form, an empty FileUpload with uninitialized properties is returned to the Presenter. Once the data is processed by underlying code, by calling the
__toString()
method on the object, which is typed as returning string, it will, based on version, either end onnull returned, expected string
, or$tmpName must not be accessed before initialization
Expected Behavior
The method that should return a string returns a string.
Possible Solution
Happy to prepare a PR once I know what the preferred solution is.
The text was updated successfully, but these errors were encountered: