Skip to content

Conversation

srijaydeathwish
Copy link

Fixed "Trying to access array offset on value of type null in FileUpload\FileNameGenerator\Random.php" with simple not empty check on "content_range[1]" variable.

Copy link

@editionslva editionslva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd better test isset($content_range[1]) and not just if array is empty, I suppose.
That 's possible if $SERVER['HTTP_CONTENT_RANGE'] is defined but void then preg_split will return an array with only one element.
After that, if $uploaded_bytes is not defined you could also have a notice on line 75 . That' why I propose if (isset($content_range[1]) {...} else { $uploaded_bytes = '';} or maybe better include the next while in the if statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants