-
Notifications
You must be signed in to change notification settings - Fork 205
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
Notice: Trying to access array offset on value of type bool in #117
Comments
This throws an error in Latest PHP Versions.
|
Same issue for me. Is this resolved for you? |
should be:
|
The above solution posted by @epagecity addresses the "Trying to access array offset on value of type bool" error by checking if the $dims[4] and $dims[5] indices are set before accessing them, using the isset() function. This ensures that the code doesn't attempt to access non-existent array elements and avoids the error. However, $dst_w and $dst_h will be set to empty strings if the respective indices are not set. I suggest setting $dst_w and $dst_h to the original width and height as it seems more appropriate since it ensures that the variables have valid numeric values. The previous solution sets them to empty strings, which might cause unexpected behavior when these variables are later used in numeric operations. Instead of the above solution, you could use the following if you want the suggested fallback behavior:
Note: This solution is tested on PHP 8. |
Worked for me, thanks. I also think that fallback to original w/h better than null. |
@Spiritvn I am fare from understand any of php. how your code match into aq_resizer.php?
/* $dims = image_resize_dimensions( $orig_w, $orig_h, $width, $height, $crop );
kind regards Moon |
I am getting this error on my site.
Notice: Trying to access array offset on value of type bool in /homepages/6/d22556011/htdocs/clickandbuilds/HomeOfficeToGo/wp-content/themes/configurator/framework/plugins/aq_resizer.php on line 115
Notice: Trying to access array offset on value of type bool in /homepages/6/d22556011/htdocs/clickandbuilds/HomeOfficeToGo/wp-content/themes/configurator/framework/plugins/aq_resizer.php on line 116
The code on line 115, 116 is:
Thanks in advance!
The text was updated successfully, but these errors were encountered: