]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5721 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Feb 2023 18:29:04 +0000 (19:29 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Feb 2023 18:29:04 +0000 (19:29 +0100)
app/Jobs/FluidbookCompiler.php
app/Models/FluidbookPublication.php

index 44667a345a8dc9bb87129772d8ac2503a40f2957..128c8068782739ea37b9bbca41731dac62c9906d 100644 (file)
@@ -2830,6 +2830,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $opt = $this->wdir . '/' . $clean;
 
         if (!file_exists($opt) || !filesize($opt) || filemtime($path) > filemtime($opt)) {
+            if (file_exists($opt) && is_link($opt)) {
+                unlink($opt);
+            }
             SVGTools::_optimizeSVG($path, $opt);
         }
         return $clean;
@@ -3435,6 +3438,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         if (file_exists($fixed) && filemtime($fixed) >= filemtime($source)) {
             return $fixed;
         }
+        if (file_exists($fixed) && is_link($fixed)) {
+            unlink($fixed);
+        }
         $svg = simplexml_load_string(file_get_contents($source));
         $attr = $svg->attributes();
         if (isset($attr['width'], $attr['height'])) {
index 33e31809d65d1a506b3d866413a69fd7dccbb815..2a5b5e36828f3c9436513f323c3e067a5868bf2a 100644 (file)
@@ -352,12 +352,12 @@ class FluidbookPublication extends ToolboxSettingsModel
 
     public function getAssetDir()
     {
-        return Files::mkdir('/application/protected/fluidbookpublication/working/' . $this->id);
+        return Files::mkdir(protected_path('fluidbookpublication/working/' . $this->id));
     }
 
     public function asset_path($path)
     {
-        return $this->getAssetDir() . '/' . $path;
+        return $this->getAssetDir() . ltrim($path,'/');
     }
 
     public function getCompositionUpdate(): int