-
Notifications
You must be signed in to change notification settings - Fork 112
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
Conversation
"each" removed in PHP8
Can one of the admins verify this patch? |
(Standard links)
|
jenkins test this please |
kcfinder/lib/class_image.php
Outdated
list($key, $width) = each($image); | ||
list($key, $height) = each($image); | ||
$width = $image[0]; | ||
$height = $image[1]; |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jenkins add to whitelist
jenkins add to whitelist |
"each" removed in PHP8