This commit is contained in:
Daniel Brendel
2022-09-30 12:50:31 +02:00
parent c7e4bb7d36
commit 90e358d7f9
2 changed files with 30 additions and 1 deletions

29
app/modules/Utils.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* Class Utils
*
* Utility methods
*/
class Utils
{
/**
* Return URL without HTTP or HTTPS port
*
* @return string
*/
public static function url($to)
{
$url = url($to);
if (strpos($url, ':80/') !== false) {
$url = str_replace(':80/', '/', $url);
}
if (strpos($url, ':443/') !== false) {
$url = str_replace(':443/', '/', $url);
}
return $url;
}
}