Skip to content

Commit 5562c03

Browse files
committed
Fix trimming of site name with html entities
1 parent f22aba3 commit 5562c03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

event/listener.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function pwa_icon_name($value, $key)
211211
*/
212212
public function pwa_short_sitename($value, $key)
213213
{
214-
$placeholder = $this->trim_shortname(ext::decode_entities($this->config['sitename']));
214+
$placeholder = $this->trim_shortname($this->config['sitename']);
215215

216216
return '<input id="' . $key . '" type="text" size="40" maxlength="12" name="config[' . $key . ']" value="' . $value . '" placeholder="' . $placeholder . '">';
217217
}
@@ -366,6 +366,6 @@ protected function can_use_notifications()
366366
*/
367367
protected function trim_shortname($name)
368368
{
369-
return utf8_substr($name, 0, 12);
369+
return htmlspecialchars(utf8_substr(ext::decode_entities($name, ENT_QUOTES), 0, 12), ENT_QUOTES, 'UTF-8');
370370
}
371371
}

0 commit comments

Comments
 (0)