Skip to content
This repository
Browse code

updated of_sanitize_font_size to latest version

  • Loading branch information...
commit 7373c905324f29728848310f4f68fe8ef38f0432 1 parent ab99ed0
Weslly H weslly authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 options-sanitize.php
10 options-sanitize.php
@@ -193,13 +193,13 @@ function of_sanitize_typography( $input, $option ) {
193 193
194 194 function of_sanitize_font_size( $value ) {
195 195 $recognized = of_recognized_font_sizes();
196   - $value = preg_replace('/px/','', $value);
197   - if ( in_array( (int) $value, $recognized ) ) {
198   - return (int) $value;
  196 + $value_check = preg_replace('/px/','', $value);
  197 + if ( in_array( (int) $value_check, $recognized ) ) {
  198 + return $value;
199 199 }
200   - return (int) apply_filters( 'of_default_font_size', $recognized );
  200 + return apply_filters( 'of_default_font_size', $recognized );
201 201 }
202   -add_filter( 'of_font_face', 'of_sanitize_font_size' );
  202 +add_filter( 'of_font_size', 'of_sanitize_font_size' );
203 203
204 204
205 205 function of_sanitize_font_style( $value ) {

0 comments on commit 7373c90

George Mamadashvili

I think str_replace() would be better for a such simple replace.

Please sign in to comment.
Something went wrong with that request. Please try again.