From: vincent@cubedesigners.com Date: Mon, 21 Nov 2022 08:50:34 +0000 (+0000) Subject: wip #5590 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d82dfe9312de573184ef5fabbfaa402ac68e0b1a;p=cubeextranet.git wip #5590 @0.5 --- diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 82750303a..39b326f09 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -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); diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 1427826f7..b10fa73e2 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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"> 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"> } } - 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"> 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;