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);
// 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 {
// 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 {
}
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 {
}
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 {
protected function _wdirOrAbsolute($path)
{
+ $path = commonTools::fixpath($path);
$e = explode('#', $path);
if (file_exists($e[0])) {
return $path;
}
}
- 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]);
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;