@@ -210,7 +210,7 @@ public function pwa_icon_name($value, $key)
210210 */
211211 public function pwa_short_sitename ($ value , $ key )
212212 {
213- $ placeholder = $ this ->trim_shortname ($ this ->config ['sitename ' ]);
213+ $ placeholder = $ this ->trim_shortname ($ this ->decode_entities ( $ this -> config ['sitename ' ]) );
214214
215215 return '<input id=" ' . $ key . '" type="text" size="40" maxlength="12" name="config[ ' . $ key . ']" value=" ' . $ value . '" placeholder=" ' . $ placeholder . '"> ' ;
216216 }
@@ -242,7 +242,7 @@ public function validate_pwa_options($event)
242242 return ;
243243 }
244244
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 ' ]);
246246
247247 // Do not allow strings longer than 12 characters
248248 if (mb_strlen ($ short_name , 'UTF-8 ' ) > 12 )
@@ -365,6 +365,17 @@ protected function can_use_notifications()
365365 */
366366 protected function trim_shortname ($ name )
367367 {
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 ' );
369380 }
370381}
0 commit comments