crayon-syntax-highlighter
crayon-syntax-highlighter copied to clipboard
Update crayon_formatter.class.php
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;';