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

PHP 7.2 throw the sizeof warning #26

Closed
zotopteam opened this issue Jan 18, 2018 · 4 comments
Closed

PHP 7.2 throw the sizeof warning #26

zotopteam opened this issue Jan 18, 2018 · 4 comments

Comments

@zotopteam
Copy link

zotopteam commented Jan 18, 2018

When uploadfile under PHP 7.2 , throw the sizeof warning:

sizeof(): Parameter must be an array or an object that implements Countable

File:

vendor\jildertmiedema\laravel-plupload\src\JildertMiedema\LaravelPlupload\Receiver.php

Line: 73

$file = new UploadedFile($filePath, $originalName, 'blob', sizeof($filePath), UPLOAD_ERR_OK, true);

I found this:

http://www.php.net/count

7.2.0 count() will now yield a warning on invalid countable types passed to the array_or_countable parameter.

Waiting Help,Thanks!

@Fraganya
Copy link

well $filepath seems to be a string so i replaced strlen($filepath) with sizeof or count. and it worked for me

@shaktijs
Copy link

Hi,

It looks like we need "filesize" function instead of "sizeof" to fix this error. I changed this and it works perfectly. If it is correct please add a commit for this.

vendor\jildertmiedema\laravel-plupload\src\JildertMiedema\LaravelPlupload\Receiver.php

Line: 73

$file = new UploadedFile($filePath, $originalName, 'blob', sizeof($filePath), UPLOAD_ERR_OK, true);

@jildertmiedema
Copy link
Owner

PR is merged

@qanvo
Copy link

qanvo commented Jul 16, 2018

Hi,
Please, can you release the git repo, i think you forgot to push tags.
Thanks for your works !

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

No branches or pull requests

5 participants