appengine-php-sdk icon indicating copy to clipboard operation
appengine-php-sdk copied to clipboard

Make CloudStorageTools::createUploadUrl compatible with PHP7

Open goodevilgenius opened this issue 6 years ago • 2 comments

createUploadUrl calls getUploadMaxFileSizeInBytes, which does the following operation on a mostly-numeric string:

$val *= 1024

In PHP5, this works fine, because non-numeric values are stripped from the end.

In PHP7, a warning is issued which states A non well formed numeric value encountered.

The value has a final non-numeric character which can be stripped to prevent this warning.

This will continue to function in PHP5 as well.

Fixes #10

Other changes were necessary simply to get the build to pass.

goodevilgenius avatar Mar 20 '18 15:03 goodevilgenius

Coverage Status

Coverage increased (+1.0%) to 11.123% when pulling 070f50318f91ed0db9fff014848fbb9f7eaec6cb on goodevilgenius:upload-max-size-php7 into 6bdf4bcb638782526a6969aa36528ac583cbc3da on GoogleCloudPlatform:master.

coveralls avatar Mar 20 '18 16:03 coveralls

I'm currently facing this issue, may I know what the status is for it?

agnosticaf avatar May 02 '18 09:05 agnosticaf