File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,14 @@ function get_modules() {
66
66
foreach ( $ available_modules as $ module ) {
67
67
if ( $ module_array = $ this ->jetpack ->get_module ( $ module ) ) {
68
68
$ short_desc = apply_filters ( 'jetpack_short_module_description ' , $ module_array ['description ' ], $ module );
69
- // Fix: correct multibyte strings truncate
70
- $ short_desc_trunc = ( mb_strlen ( $ short_desc ) > 143 )
71
- ? mb_substr ( $ short_desc , 0 , 140 ) . '... '
72
- : $ short_desc ;
69
+ // Fix: correct multibyte strings truncate with checking for mbstring extension
70
+ $ short_desc_trunc = ( function_exists ( 'mb_strlen ' ) )
71
+ ? ( ( mb_strlen ( $ short_desc ) > 143 )
72
+ ? mb_substr ( $ short_desc , 0 , 140 ) . '... '
73
+ : $ short_desc )
74
+ : ( ( strlen ( $ short_desc ) > 143 )
75
+ ? substr ( $ short_desc , 0 , 140 ) . '... '
76
+ : $ short_desc );
73
77
74
78
$ module_array ['module ' ] = $ module ;
75
79
$ module_array ['activated ' ] = ( $ jetpack_active ? in_array ( $ module , $ active_modules ) : false );
You can’t perform that action at this time.
0 commit comments