mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-16 02:34:54 +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)), '_');
|
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $input)), '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeIfFirstSlash(&$text) {
|
function removeIfFirstSlash(&$text): void
|
||||||
|
{
|
||||||
if(strpos($text, '/') === 0) {
|
if(strpos($text, '/') === 0) {
|
||||||
$text = str_replace_first('/', '', $text);
|
$text = str_replace_first('/', '', $text);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function escapeHtml($html) {
|
function escapeHtml($html): string {
|
||||||
return htmlspecialchars($html);
|
return htmlspecialchars($html);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1660,7 +1661,7 @@ function getGuildNameById($id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGuildLogoById($id)
|
function getGuildLogoById($id): string
|
||||||
{
|
{
|
||||||
$logo = 'default.gif';
|
$logo = 'default.gif';
|
||||||
|
|
||||||
@@ -1676,7 +1677,8 @@ function getGuildLogoById($id)
|
|||||||
return BASE_URL . GUILD_IMAGES_DIR . $logo;
|
return BASE_URL . GUILD_IMAGES_DIR . $logo;
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayErrorBoxWithBackButton($errors, $action = null) {
|
function displayErrorBoxWithBackButton($errors, $action = null): void
|
||||||
|
{
|
||||||
global $twig;
|
global $twig;
|
||||||
$twig->display('error_box.html.twig', ['errors' => $errors]);
|
$twig->display('error_box.html.twig', ['errors' => $errors]);
|
||||||
$twig->display('account.back_button.html.twig', [
|
$twig->display('account.back_button.html.twig', [
|
||||||
|
Reference in New Issue
Block a user