From 79d745a26b7586dba449d476b9c7bac2c823b587 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 11 Nov 2016 12:57:28 +0200 Subject: [PATCH] Simplify logo URL code --- app/Models/Account.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 8a81fa24f1cc..5825d8d32ba3 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -748,15 +748,13 @@ class Account extends Eloquent if($adapter instanceof \League\Flysystem\Adapter\Local) { // Stored locally - $logo_url = str_replace(public_path(), url('/'), $adapter->applyPathPrefix($this->logo), $count); + $logoUrl = url('/logo/' . $this->logo); if ($cachebuster) { - $logo_url .= '?no_cache='.time(); + $logoUrl .= '?no_cache='.time(); } - if($count == 1){ - return str_replace(DIRECTORY_SEPARATOR, '/', $logo_url); - } + return $logoUrl; } return Document::getDirectFileUrl($this->logo, $this->getLogoDisk());