Skip to content

Commit 9851562

Browse files
authored
added conditional
mb_strlen if function exists
1 parent 92b9f96 commit 9851562

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

acf-input-counter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function render_field($field) {
7878
// only run on text and text area fields when maxlength is set
7979
return;
8080
}
81-
$len = mb_strlen($field['value']);
81+
if (function_exists('mb_strlen')) {
82+
$len = mb_strlen($field['value']);
83+
} else {
84+
$len = strlen($field['value']);
85+
}
8286
$max = $field['maxlength'];
8387

8488
$classes = apply_filters('acf-input-counter/classes', array());
@@ -181,4 +185,4 @@ function show_blunt_plugins_list_meta_box() {
181185
}
182186
} // end if !function_exists
183187

184-
?>
188+
?>

0 commit comments

Comments
 (0)