]> source.dussan.org Git - nextcloud-server.git/commitdiff
fall back to absolute path for pipelined assets (#14940)
authorAdam Williamson <awilliam@redhat.com>
Tue, 17 Mar 2015 02:06:06 +0000 (19:06 -0700)
committerAdam Williamson <awilliam@redhat.com>
Tue, 17 Mar 2015 02:08:11 +0000 (19:08 -0700)
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).

lib/private/templatelayout.php

index 3220d9d969c3988f17205e1bbeb5152f276d0bb0..3f8422b9f0bfdbc93d5b92362915b5f72f907768 100644 (file)
@@ -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);