Closed ioannisth closed 1 year ago
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; } }
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.
Bug Description
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
Screenshots
Additional context
[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