Skip to content

Commit f5a43aa

Browse files
committed
Rename get_shortname to trim_shortname
1 parent 67cb0ab commit f5a43aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

event/listener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function pwa_manifest()
144144
$this->template->assign_vars([
145145
'U_MANIFEST_URL' => $this->controller_helper->route('phpbb_webpushnotifications_manifest_controller'),
146146
'U_TOUCH_ICON' => $this->config['pwa_icon_small'],
147-
'SHORT_SITE_NAME' => $this->config['pwa_short_name'] ?: $this->get_shortname($this->config['sitename']),
147+
'SHORT_SITE_NAME' => $this->config['pwa_short_name'] ?: $this->trim_shortname($this->config['sitename']),
148148
]);
149149
}
150150

@@ -210,7 +210,7 @@ public function pwa_icon_name($value, $key)
210210
*/
211211
public function pwa_short_sitename($value, $key)
212212
{
213-
$placeholder = $this->get_shortname($this->config['sitename']);
213+
$placeholder = $this->trim_shortname($this->config['sitename']);
214214

215215
return '<input id="' . $key . '" type="text" size="40" maxlength="12" name="config[' . $key . ']" value="' . $value . '" placeholder="' . $placeholder . '">';
216216
}
@@ -358,12 +358,12 @@ protected function can_use_notifications()
358358
}
359359

360360
/**
361-
* Get short name from a string (decode any entities and trim to 12 characters)
361+
* Trim short name from a string to 12 characters
362362
*
363363
* @param string $name
364364
* @return string 12 max characters string
365365
*/
366-
protected function get_shortname($name)
366+
protected function trim_shortname($name)
367367
{
368368
return utf8_substr(html_entity_decode($name, ENT_QUOTES, 'UTF-8'), 0, 12);
369369
}

0 commit comments

Comments
 (0)