crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

Update crayon_formatter.class.php

Open yokada opened this issue 5 years ago • 1 comments

yokada avatar Oct 14 '18 20:10 yokada

To provide some context on this, logs are getting filled up with the following PHP notice:

PHP Notice:  A non well formed numeric value encountered in /path/to/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

The issue appears to be that mathematical operations are being carried out on the string version of $font_size, not the numeric value.

// Defined at the top of the method:
$_font_size = $hl->setting_val(CrayonSettings::FONT_SIZE);
$font_size = $_font_size . 'px !important;';

// This would be `$_font_size . 'px !important;' * 1.5 . 'px !important;'.
$toolbar_height = $font_size * 1.5 . 'px !important;';

stevegrunwell avatar Mar 17 '19 22:03 stevegrunwell