From 83c3add386c187dbf06b9ff5cf33e749a35d1f23 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Tue, 26 Mar 2019 20:39:56 +0100 Subject: fix media target when W is not in a subfolder --- app/class/media.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/class') diff --git a/app/class/media.php b/app/class/media.php index 01dfd55..cd6c6f0 100644 --- a/app/class/media.php +++ b/app/class/media.php @@ -56,7 +56,12 @@ class Media public function getfullpath() { - $fullpath = '/' . Config::basepath() . '/'. $this->path() . $this->id() . '.' . $this->extension(); + if(!empty(Config::basepath())) { + $base = '/' . Config::basepath(); + } else { + $base = ''; + } + $fullpath = $base . '/'. $this->path() . $this->id() . '.' . $this->extension(); $fullpath = str_replace('\\', '/', $fullpath); return $fullpath; } -- cgit v1.2.3