? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
16 Apr 2020

PHP8 changed the behavior of GD to use objects instead of resources. This introduces version dependent handling in the code and thus should make this work again. Since we have good unittests for this, this should be enough to test this.

avatar Hackwar Hackwar - open - 16 Apr 2020
avatar Hackwar Hackwar - change - 16 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Apr 2020
Category Libraries
avatar Hackwar Hackwar - change - 16 Apr 2020
Labels Added: ?
avatar richard67
richard67 - comment - 16 Apr 2020

@Hackwar Just a question from reading: Ist it correct that the first check if $source is true applies only to the first || condition in lines 128 and 129?

if ($source && (\is_object($source) && get_class($source) == 'GdImage')
	|| (\is_resource($source) && get_resource_type($source) == 'gd'))

Or should it apply in both of the cases separated by the || as follows:

if ($source && (\is_object($source) && get_class($source) == 'GdImage'
	|| \is_resource($source) && get_resource_type($source) == 'gd'))

As I said, just a question from reading, maybe all is fine as is it.

avatar Hackwar
Hackwar - comment - 16 Apr 2020

No, that is fine the way it is. $source can be null and get_class(null) (or anything not an object) will throw an error.

Anyhow, with this PR and the bunch of changes we did to drone and the docker images used, I can now happily proclaim that we are passing all tests.

avatar zero-24
zero-24 - comment - 16 Apr 2020

hmm can you think of any reason that RIPS would complain about files in this path: libraries/vendor/hoa I don't see that this PR touches anything around that path and is also not introducing new composer deps as well as this path does not seem to be included in with an composer install?

avatar SniperSister
SniperSister - comment - 17 Apr 2020

@zero-24 seems to be a RIPS glitch. Whitelisted the issues and restarted the build

avatar HLeithner
HLeithner - comment - 17 Apr 2020

We should be consistent on how we handle this. I think its enough if we check for object and resource (including type) and not for the php version. Also please add a comment that resource can be removed if we only support php 8+

avatar Hackwar
Hackwar - comment - 17 Apr 2020

I added the comments and unified the handling. Please review again and give thumbs up/down.

avatar HLeithner HLeithner - change - 29 May 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-29 11:18:11
Closed_By HLeithner
avatar HLeithner HLeithner - close - 29 May 2020
avatar HLeithner HLeithner - merge - 29 May 2020
avatar HLeithner
HLeithner - comment - 29 May 2020

Thanks

Add a Comment

Login with GitHub to post a comment