From 1f192bc0ea6a41fe2702dac0386390225188b127 Mon Sep 17 00:00:00 2001 From: horus Date: Tue, 14 May 2019 12:06:00 +0200 Subject: Rewrites images through a reverse proxy (camo) to increase privacy and prevent mixed contents warnings. --- app/Libraries/TemplateFunction.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/Libraries/TemplateFunction.php') 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; + } } -- cgit v1.2.3