@@ -210,7 +210,7 @@ public function pwa_icon_name($value, $key)
210
210
*/
211
211
public function pwa_short_sitename ($ value , $ key )
212
212
{
213
- $ placeholder = $ this ->trim_shortname ($ this ->config ['sitename ' ]);
213
+ $ placeholder = $ this ->trim_shortname ($ this ->decode_entities ( $ this -> config ['sitename ' ]) );
214
214
215
215
return '<input id=" ' . $ key . '" type="text" size="40" maxlength="12" name="config[ ' . $ key . ']" value=" ' . $ value . '" placeholder=" ' . $ placeholder . '"> ' ;
216
216
}
@@ -242,7 +242,7 @@ public function validate_pwa_options($event)
242
242
return ;
243
243
}
244
244
245
- $ short_name = html_entity_decode ($ event ['cfg_array ' ]['pwa_short_name ' ], ENT_QUOTES , ' UTF-8 ' );
245
+ $ short_name = $ this -> decode_entities ($ event ['cfg_array ' ]['pwa_short_name ' ]);
246
246
247
247
// Do not allow strings longer than 12 characters
248
248
if (mb_strlen ($ short_name , 'UTF-8 ' ) > 12 )
@@ -365,6 +365,17 @@ protected function can_use_notifications()
365
365
*/
366
366
protected function trim_shortname ($ name )
367
367
{
368
- return utf8_substr (html_entity_decode ($ name , ENT_QUOTES , 'UTF-8 ' ), 0 , 12 );
368
+ return utf8_substr ($ name , 0 , 12 );
369
+ }
370
+
371
+ /**
372
+ * Decode entities, used primarily to fix emoji for display
373
+ *
374
+ * @param $text
375
+ * @return string Decoded string
376
+ */
377
+ protected function decode_entities ($ text )
378
+ {
379
+ return html_entity_decode ($ text , ENT_QUOTES , 'UTF-8 ' );
369
380
}
370
381
}
0 commit comments