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

Update class_image.php for PHP8 #358

Merged
merged 2 commits into from
Jan 8, 2023
Merged

Update class_image.php for PHP8 #358

merged 2 commits into from
Jan 8, 2023

Conversation

Michael-Labriola
Copy link
Contributor

"each" removed in PHP8

"each" removed in PHP8
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Jan 7, 2023

(Standard links)

@civibot civibot bot added the master label Jan 7, 2023
@demeritcowboy
Copy link
Contributor

jenkins test this please

list($key, $width) = each($image);
list($key, $height) = each($image);
$width = $image[0];
$height = $image[1];
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically this would fail if somebody did something like $gd = new image_gd(['w' => 200, 'h' => 200]);. I don't see it used that way anywhere, but it might be safer to use

$width = array_shift($image);
$height = array_shift($image);

Copy link
Contributor Author

@Michael-Labriola Michael-Labriola Jan 8, 2023

Choose a reason for hiding this comment

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

That looks good to me. I updated the pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great. I see this is your first contribution. Thanks for this. For release notes credit can do you do another PR to add yourself to this file: https://github.com/civicrm/civicrm-core/blob/master/contributor-key.yml

Copy link
Contributor

Choose a reason for hiding this comment

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

jenkins add to whitelist

@demeritcowboy
Copy link
Contributor

jenkins add to whitelist

@demeritcowboy demeritcowboy merged commit 18915b5 into civicrm:master Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants