mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Disable options for other peoples clients.
This commit is contained in:
@@ -49,6 +49,7 @@ class General extends AbstractExtension
|
||||
$this->mimeIcon(),
|
||||
$this->markdown(),
|
||||
$this->floatval(),
|
||||
$this->phpHostName(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -91,6 +92,24 @@ class General extends AbstractExtension
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show URL host name
|
||||
*
|
||||
* @return TwigFilter
|
||||
*/
|
||||
protected function phpHostName(): TwigFilter
|
||||
{
|
||||
return new TwigFilter(
|
||||
'phphost',
|
||||
static function (string $string): string {
|
||||
$proto = (string)parse_url($string, PHP_URL_SCHEME);
|
||||
$host = (string)parse_url($string, PHP_URL_HOST);
|
||||
|
||||
return e(sprintf('%s://%s', $proto, $host));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to convert 1024 to 1kb etc.
|
||||
*
|
||||
|
Reference in New Issue
Block a user