Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strings being used as a numerical value #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix strings being used as a numerical value #401

wants to merge 1 commit into from

Conversation

stephenharris
Copy link

$font_size holds the font size as a string, e.g. ("12px !important;"), but is being used in calculations such as $_font_size * 1.5. On PHP 7+ this will give a notice. For calculations, the numerical value stored in $_font_size or CrayonGlobalSettings::get(CrayonSettings::FONT_SIZE))->def() should be used instead.

Fixes one of the issues reported in https://wordpress.org/support/topic/failed-to-open-stream-error-when-creating-new-post/#post-8663430

`$font_size` holds the font size as a string, e.g. (`"12px !important;"`), but is being used in calculations such as `$_font_size * 1.5`. On PHP 7+ this will give a notice. For calculations, the numerical value stored in `$_font_size`  or `CrayonGlobalSettings::get(CrayonSettings::FONT_SIZE))->def()` should be used instead.

Fixes one of the issues reported in https://wordpress.org/support/topic/failed-to-open-stream-error-when-creating-new-post/#post-8663430
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant