matomo-org / component-decompress

Decompress files
GNU Lesser General Public License v3.0
12 stars 12 forks source link

Convert to integer to avoid PHP warning #9

Closed nztim closed 7 years ago

nztim commented 7 years ago

I received the following warning the last two times I updated Piwik (PHP 7.1):

WARNING: .../public/vendor/piwik/decompress/libs/PclZip/pclzip.lib.php(1797): Notice - A non well formed numeric value encountered

This fix is intended to resolve the problem by converting to integer before the multiplication operation. The existing tests trigger the warning and now pass with this change on PHP 7.1.

NickDickinsonWilde commented 7 years ago

+1 Been using this as a patch with cweagans/composer-patches in my edited composer.json for piwik & been working fine for a couple weeks.

sgiehl commented 7 years ago

@tsteur @mattab do we still maintain the list of changes in https://github.com/piwik/component-decompress/blob/master/libs/README.md? Or is it already outdated since the updates for PHP 7?

mattab commented 7 years ago

@sgiehl we should still maintain those changes if they haven't been fixed upstream. Unless they are not needed anymore for some other reason, but it'd be hard to know which changes are not needed anymore...

nztim commented 7 years ago

I've added a comment to that file, does it look right?

mattab commented 7 years ago

Thanks @nztim - @sgiehl looks good to merge. Are you able to merge & publish new release & use it in piwik core?