]> _ Git - cubeextranet.git/commitdiff
wip #5742 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Feb 2023 12:35:08 +0000 (12:35 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Feb 2023 12:35:08 +0000 (12:35 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 871724d58cdccee47f98a4fe45fdbee0cd6b39c5..3c84a7304cf47bbf875100249c4d1cf9d8c83316 100644 (file)
@@ -3646,22 +3646,16 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
     {
         $fdir = is_null($baseDir) ? 'data/links/' . str_replace('.', '_', $file) : commonTools::fixpath($baseDir);
 
-        $tmp = CubeIT_Files::tmpdir();
-        $dir = $tmp . '/' . $fdir;
-        if (file_exists($dir) && is_file($dir)) {
-            unlink($dir);
-        }
+        $zipPath = $this->wdir . '/' . $file;
+        $dir = WS_CACHE . '/unzip/' . CubeIT_Files::hashFileAttributes($zipPath);
+
         if (!file_exists($dir)) {
             mkdir($dir, 0777, true);
-        }
-        $unzip = new cubeCommandLine('unzip');
-        $unzip->setArg(null, $this->wdir . '/' . $file);
-        $unzip->setArg('d', $dir);
-        $unzip->execute();
-
-        if ($moveAssets) {
-            `mv $dir/Assets/* $dir`;
-            rmdir($dir . '/Assets');
+            CubeIT_Util_Zip::extract($zipPath, $dir);
+            if ($moveAssets) {
+                `mv $dir/Assets/* $dir`;
+                rmdir($dir . '/Assets');
+            }
         }
 
         return array('dir' => $dir, 'fdir' => $fdir);