mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-15 18:24:56 +02:00
Update functions.php
This commit is contained in:
@@ -1640,13 +1640,14 @@ function camelCaseToUnderscore($input)
|
||||
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $input)), '_');
|
||||
}
|
||||
|
||||
function removeIfFirstSlash(&$text) {
|
||||
function removeIfFirstSlash(&$text): void
|
||||
{
|
||||
if(strpos($text, '/') === 0) {
|
||||
$text = str_replace_first('/', '', $text);
|
||||
}
|
||||
};
|
||||
|
||||
function escapeHtml($html) {
|
||||
function escapeHtml($html): string {
|
||||
return htmlspecialchars($html);
|
||||
}
|
||||
|
||||
@@ -1660,7 +1661,7 @@ function getGuildNameById($id)
|
||||
return false;
|
||||
}
|
||||
|
||||
function getGuildLogoById($id)
|
||||
function getGuildLogoById($id): string
|
||||
{
|
||||
$logo = 'default.gif';
|
||||
|
||||
@@ -1676,7 +1677,8 @@ function getGuildLogoById($id)
|
||||
return BASE_URL . GUILD_IMAGES_DIR . $logo;
|
||||
}
|
||||
|
||||
function displayErrorBoxWithBackButton($errors, $action = null) {
|
||||
function displayErrorBoxWithBackButton($errors, $action = null): void
|
||||
{
|
||||
global $twig;
|
||||
$twig->display('error_box.html.twig', ['errors' => $errors]);
|
||||
$twig->display('account.back_button.html.twig', [
|
||||
|
Reference in New Issue
Block a user