|
17 | 17 | use phpbb\notification\manager; |
18 | 18 | use phpbb\template\template; |
19 | 19 | use phpbb\user; |
| 20 | +use phpbb\webpushnotifications\ext; |
20 | 21 | use phpbb\webpushnotifications\form\form_helper; |
21 | 22 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
22 | 23 |
|
@@ -210,7 +211,7 @@ public function pwa_icon_name($value, $key) |
210 | 211 | */ |
211 | 212 | public function pwa_short_sitename($value, $key) |
212 | 213 | { |
213 | | - $placeholder = $this->trim_shortname($this->decode_entities($this->config['sitename'])); |
| 214 | + $placeholder = $this->trim_shortname(ext::decode_entities($this->config['sitename'])); |
214 | 215 |
|
215 | 216 | return '<input id="' . $key . '" type="text" size="40" maxlength="12" name="config[' . $key . ']" value="' . $value . '" placeholder="' . $placeholder . '">'; |
216 | 217 | } |
@@ -242,7 +243,7 @@ public function validate_pwa_options($event) |
242 | 243 | return; |
243 | 244 | } |
244 | 245 |
|
245 | | - $short_name = $this->decode_entities($event['cfg_array']['pwa_short_name']); |
| 246 | + $short_name = ext::decode_entities($event['cfg_array']['pwa_short_name'], ENT_QUOTES); |
246 | 247 |
|
247 | 248 | // Do not allow strings longer than 12 characters |
248 | 249 | if (utf8_strlen($short_name) > 12) |
@@ -367,15 +368,4 @@ protected function trim_shortname($name) |
367 | 368 | { |
368 | 369 | return utf8_substr($name, 0, 12); |
369 | 370 | } |
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'); |
380 | | - } |
381 | 371 | } |
0 commit comments