• Hello everyone, we are using the plugin on our website running on WordPress 6.3.1 and PHP 8.1.2 and it is triggering the following error:

    PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - string in (…)/wp-content/plugins/mega-addons-for-visual-composer/render/infobox.php:67

    We identified the problem lies on this piece of line 67:

    line-height: <?php esc_attr($icon_height - $border_width); ?>px;

    A possible fix would be casting the variables to int:

    line-height: <?php esc_attr((int)$icon_height - (int)$border_width); ?>px;

    This was enough for it to work on our website but there may be more occurrences out there in the code.

    Thanks,

    Marcus

Viewing 2 replies - 1 through 2 (of 2 total)
  • subhansafdars

    (@subhansafdars)

    Hi yes getting same error on my site. Please guide me how we can fix this issue ASAP. As it causes DB connection issues as well.

    PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - string in (…)/wp-content/plugins/mega-addons-for-visual-composer/render/infobox.php:67

    Please help!

    Same issue here.

    I fixed it:

    line-height: <?php echo esc_attr((int)$icon_height-(int)$border_width); ?>px;

    Please update this on the next release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Fatal error: Uncaught TypeError: Unsupported operand types’ is closed to new replies.