You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting a crash (HTTP ERROR 500) when trying to edit page with WP Bakery and Cloudinary plugin activated #863
When I am trying to edit a page with WP Bakery on a live site (running on OpenLiteSpeed web server) with the cloudinary plugin activated, I get HTTP ERROR 500
Expected Behaviour
I should be able to enter the WP Bakery Visual Composer. The default WP editor works fine
Steps to reproduce
Go to pages
Click on a page, then click edit
See error
Screenshots
Additional context
WordPress version: 6.1.1
Plugin version: 3.0.9
Gutenberg plugin version (if applicable):
PHP version: 8.0.7
OpenLiteSpeed log during the crash:
[3910065] [162.158.86.84:18486-2#wordpress] [STDERR] PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php:1282
Stack trace:
#0 [internal function]: Cloudinary\Delivery->parse_element() #1 /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php(919): array_map() #2 /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php(1742): Cloudinary\Delivery->convert_tags() #3 /var/www/html/wp-includes/class-wp-hook.php(308): Cloudinary\Delivery->catch_urls() #4 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #5 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #6 /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-string-replace.php(270): do_action() #7 /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-string-replace.php(296): Cloudinary\String_Replace->prime_replacements() #8 [internal function]: Cloudinary\String_Replace->replace_strings() #9 {main}
thrown in /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php on line 1282
Inside wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php, line 1282 tries to divide by $has_size[1] merely by checking if $has_size is not an empty array not checking for zero values, either for $has_size[1] or $item['height']
Thank you for raising this issue. Fortunately, this has already been identified, and we have a patch.
We are currently in the last tests before we roll out 3.1.0, which will fix this issue.
We are expecting to release the new version shortly.
Activity
ioannisth commentedon Feb 16, 2023
Inside wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-delivery.php, line 1282 tries to divide by $has_size[1] merely by checking if $has_size is not an empty array not checking for zero values, either for $has_size[1] or $item['height']
if ( ! empty( $has_size ) ) { $file_ratio = round( $has_size[0] / $has_size[1], 2 ); $original_ratio = round( $item['width'] / $item['height'], 2 ); if ( $file_ratio !== $original_ratio ) { $attributes['data-crop'] = $file_ratio; } }pereirinha commentedon Feb 16, 2023
Hi @ioannisth
Thank you for raising this issue. Fortunately, this has already been identified, and we have a patch.
We are currently in the last tests before we roll out
3.1.0, which will fix this issue.We are expecting to release the new version shortly.