From: vincent@cubedesigners.com Date: Wed, 3 Oct 2018 14:11:23 +0000 (+0000) Subject: wip #2227 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=91f3cad3ccd858a15e204858e1bc697c97c2ca2d;p=cubeextranet.git wip #2227 @1 --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 690c89d22..dcef8b5c1 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -1071,7 +1071,7 @@ html{height:100%}' . "\n"; if (count($e) == 2 || $e[2] <= $time - 10) { $e[2] = $time; - http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/index.html'); + http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/'); exit; } @@ -1114,13 +1114,13 @@ html{height:100%}' . "\n"; if (count($e) == 2 || $e[2] <= $time - 10) { $e[2] = $time; - http::redirect(SITE_PATH . 'viewers/' . implode('_', $e) . '/index.html'); + http::redirect(SITE_PATH . 'viewers/' . implode('_', $e) . '/'); exit; } $book_id = $e[0]; $hash = $e[1]; - self::commonHTML5Viewer($book_id, $hash); + self::commonHTML5Viewer($book_id, $hash, '', ['' => '']); } @@ -1133,13 +1133,12 @@ html{height:100%}' . "\n"; return TIME; } - public static function commonHTML5Viewer($book_id, $hash, $version = '') + public static function commonHTML5Viewer($book_id, $hash, $version = '', $replace = []) { global $core; self::checkDocumentVersionOfBook($book_id); $dao = new wsDAOBook($core->con); - $dir = ''; $book = $dao->selectById($book_id); @@ -1158,9 +1157,11 @@ html{height:100%}' . "\n"; } self::logReferer($book_id); - - echo file_get_contents(WS_BOOKS . '/html5' . $dir . '/' . $book_id . '/index' . $version . '.html'); - + $html = file_get_contents(WS_BOOKS . '/html5' . $dir . '/' . $book_id . '/index' . $version . '.html'); + foreach ($replace as $from => $to) { + $html = str_replace($from, $to, $html); + } + echo $html; exit; } @@ -1168,7 +1169,6 @@ html{height:100%}' . "\n"; { $args = cubePage::getArgs($args); - $qs = ''; if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $qs = '?' . $_SERVER['QUERY_STRING'];