]> _ Git - cubeextranet.git/commitdiff
wip #5590 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Nov 2022 08:50:34 +0000 (08:50 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Nov 2022 08:50:34 +0000 (08:50 +0000)
inc/commons/class.common.tools.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 82750303a4cd513a08a95b4101947661d5e9d27c..39b326f09022c0ea5935897d1cbb01bd77ddce4a 100644 (file)
@@ -3,8 +3,16 @@
 class commonTools
 {
 
+    public static function fixpath($path)
+    {
+        $path = str_replace('/data1/extranet/www/', '/application', $path);
+        $path = str_replace('/data/extranet/www/', '/application', $path);
+        return str_replace('/home/extranet/www/', '/application', $path);
+    }
+
     public static function hub($args)
     {
+
         global $core;
         $args = cubePage::getArgs($args);
 
index 1427826f750addefef095b5b95ac5edfb6a8c068..b10fa73e2a1aef305dfa78268fda4ac98152038e 100644 (file)
@@ -791,6 +791,7 @@ class wsHTML5Compiler
         // change it now, so we'll follow the same approach.
 
         if (!empty($this->config->basketReferences)) {
+            $this->config->basketReferences = commonTools::fixpath($this->config->basketReferences);
             if (file_exists($this->config->basketReferences) || CubeIT_Util_Url::isDistant($this->config->basketReferences)) {
                 $referencesFile = $this->config->basketReferences;
             } else {
@@ -857,6 +858,7 @@ class wsHTML5Compiler
         // change it now, so we'll follow the same approach.
 
         if (!empty($this->config->basketReferences)) {
+            $this->config->basketReferences = commonTools::fixpath($this->config->basketReferences);
             if (file_exists($this->config->basketReferences) || CubeIT_Util_Url::isDistant($this->config->basketReferences)) {
                 $referencesFile = $this->config->basketReferences;
             } else {
@@ -972,6 +974,7 @@ class wsHTML5Compiler
         }
 
         if ($this->config->product_zoom_references) {
+            $this->config->product_zoom_references = commonTools::fixpath($this->config->product_zoom_references);
             if (file_exists($this->config->product_zoom_references) || CubeIT_Util_Url::isDistant($this->config->product_zoom_references)) {
                 $referencesFile = $this->config->product_zoom_references;
             } else {
@@ -984,6 +987,7 @@ class wsHTML5Compiler
         }
 
         if ($this->config->basketReferences) {
+            $this->config->basketReferences = commonTools::fixpath($this->config->basketReferences);
             if (file_exists($this->config->basketReferences) || CubeIT_Util_Url::isDistant($this->config->basketReferences)) {
                 $referencesFile = $this->config->basketReferences;
             } else {
@@ -1242,6 +1246,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
     protected function _wdirOrAbsolute($path)
     {
+        $path = commonTools::fixpath($path);
         $e = explode('#', $path);
         if (file_exists($e[0])) {
             return $path;
@@ -2320,11 +2325,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             }
         }
 
-        if ($this->book->parametres->anchorsAliases && file_exists($this->book->parametres->anchorsAliases)) {
+        if ($this->book->parametres->anchorsAliases && file_exists(commonTools::fixpath($this->book->parametres->anchorsAliases))) {
             $aliases = [];
             $anchors = [];
             for ($i = 0; $i <= 2; $i++) {
-                $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents($this->book->parametres->anchorsAliases));
+                $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents(commonTools::fixpath($this->book->parametres->anchorsAliases)));
                 foreach ($lines as $line) {
                     $e = explode("\t", $line);
                     $from = anchorLink::normalizeAnchor($e[0]);
@@ -3559,7 +3564,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
     public function unzipFile($file, $moveAssets = false, $baseDir = null)
     {
-        $fdir = is_null($baseDir) ? 'data/links/' . str_replace('.', '_', $file) : $baseDir;
+        $fdir = is_null($baseDir) ? 'data/links/' . str_replace('.', '_', $file) : commonTools::fixpath($baseDir);
 
         $tmp = CubeIT_Files::tmpdir();
         $dir = $tmp . '/' . $fdir;