diff options
| author | horus | 2019-05-14 12:06:00 +0200 |
|---|---|---|
| committer | horus | 2019-05-14 12:06:00 +0200 |
| commit | 1f192bc0ea6a41fe2702dac0386390225188b127 (patch) | |
| tree | 4a29a16c6b477b6145a542fe8fc2c8f0186358f5 /app/Libraries | |
| parent | 53e398f69ead13feaf26cdd5ae0449fa6174e753 (diff) | |
| download | kategorischeraperitif-1f192bc0ea6a41fe2702dac0386390225188b127.tar.gz | |
Rewrites images through a reverse proxy (camo) to increase privacy and prevent mixed contents warnings.
Diffstat (limited to 'app/Libraries')
| -rw-r--r-- | app/Libraries/TemplateFunction.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/Libraries/TemplateFunction.php b/app/Libraries/TemplateFunction.php index 54a36de..c84b127 100644 --- a/app/Libraries/TemplateFunction.php +++ b/app/Libraries/TemplateFunction.php @@ -20,4 +20,16 @@ class TemplateFunction { public static function T($timestamp) { return gmdate("d.m.Y.", $timestamp); } + + public static function Camo($url) { + if ( "" != env("GOCAMO_HMAC") && "" != env("GOCAMO_URL") ) { + $phpamo = new \WillWashburn\Phpamo\Phpamo( + env("GOCAMO_HMAC"), + env("GOCAMO_URL") + ); + return $phpamo->camo($url); + } + + return $url; + } } |
