From: Adam Williamson Date: Tue, 17 Mar 2015 02:06:06 +0000 (-0700) Subject: fall back to absolute path for pipelined assets (#14940) X-Git-Tag: v8.1.0alpha1~232^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa1be7d29663166194b1059e24d0e319abdb47cd;p=nextcloud-server.git fall back to absolute path for pipelined assets (#14940) If the asset is, for example, in an apps directory that is outside the $SERVERROOT, we won't be able to get a relative path. We shouldn't just fail hard in this case. Fall back to using the absolute path instead (as we used to). --- diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index 3220d9d969c..3f8422b9f0b 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -242,7 +242,11 @@ class OC_TemplateLayout extends OC_Template { private static function hashFileNames($files) { foreach($files as $i => $file) { - $files[$i] = self::convertToRelativePath($file[0]).'/'.$file[2]; + try { + $files[$i] = self::convertToRelativePath($file[0]).'/'.$file[2]; + } catch (\Exception $e) { + $files[$i] = $file[0].'/'.$file[2]; + } } sort($files);