// try to find the temp folder
define('TMP_DIR', BasicFileUtil::getInstallTempFolder());
-/**
- * Reads a file resource from temp folder.
- *
- * @param string $key
- * @param string $directory
- */
-function readFileResource($key, $directory) {
- if (preg_match('~[\w\-]+\.(css|jpg|png|svg|eot|woff|ttf)~', $_GET[$key], $match)) {
- switch ($match[1]) {
- case 'css':
- header('Content-Type: text/css');
- break;
-
- case 'jpg':
- header('Content-Type: image/jpg');
- break;
-
- case 'png':
- header('Content-Type: image/png');
- break;
-
- case 'svg':
- header('Content-Type: image/svg+xml');
- break;
-
- case 'eot':
- header('Content-Type: application/vnd.ms-fontobject');
- break;
-
- case 'woff':
- header('Content-Type: application/font-woff');
- break;
-
- case 'ttf':
- header('Content-Type: application/octet-stream');
- break;
- }
-
- header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT');
- header('Last-Modified: Mon, 26 Jul 1997 05:00:00 GMT');
- header('Cache-Control: public, max-age=3600');
-
- readfile($directory . $_GET[$key]);
- }
- exit;
-}
-
-// show image from temp folder
-if (isset($_GET['showImage'])) {
- readFileResource('showImage', TMP_DIR . 'install/files/acp/images/');
-}
-// show icon from temp folder
-if (isset($_GET['showIcon'])) {
- readFileResource('showIcon', TMP_DIR . 'install/files/icon/');
-}
-// show css from temp folder
-if (isset($_GET['showCSS'])) {
- readFileResource('showCSS', TMP_DIR . 'install/files/acp/style/setup/');
-}
-// show fonts from temp folder
-if (isset($_GET['showFont'])) {
- readFileResource('showFont', TMP_DIR . 'install/files/font/');
-}
-
// check whether setup files are already unzipped
if (!file_exists(TMP_DIR . 'install/files/lib/system/WCFSetup.class.php')) {
// try to unzip all setup files into temp folder
'languageCode' => self::$selectedLanguageCode,
'directories' => self::$directories,
'developerMode' => self::$developerMode,
+
+ 'setupAssets' => [
+ 'WCFSetup.css' => \sprintf(
+ 'data:text/css;base64,%s',
+ \base64_encode(\file_get_contents(TMP_DIR . 'install/files/acp/style/setup/WCFSetup.css'))
+ ),
+ 'woltlabSuite.png' => \sprintf(
+ 'data:image/png;base64,%s',
+ \base64_encode(\file_get_contents(TMP_DIR . 'install/files/acp/images/woltlabSuite.png'))
+ ),
+ 'fontawesome-webfont.woff2' => \sprintf(
+ 'data:font/woff2;base64,%s',
+ \base64_encode(\file_get_contents(TMP_DIR . 'install/files/font/fontawesome-webfont.woff2'))
+ ),
+ ],
]);
}
<title>{lang}wcf.global.progressBar{/lang} - {lang}wcf.global.title{/lang}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" type="text/css" media="screen" href="{if $lastStep|isset}{@RELATIVE_WCF_DIR}acp/style/setup/{else}install.php?tmpFilePrefix={@TMP_FILE_PREFIX}&showCSS={/if}WCFSetup.css">
+ <link rel="stylesheet" type="text/css" media="screen" href="{$setupAssets['WCFSetup.css']}">
- {if !$lastStep|isset}
- <style type="text/css">
- @font-face {
- font-family: 'FontAwesome';
- src: url('install.php?tmpFilePrefix={@TMP_FILE_PREFIX}&showFont=fontawesome-webfont.eot');
- src: url('install.php?tmpFilePrefix={@TMP_FILE_PREFIX}&showFont=fontawesome-webfont.eot#iefix') format('embedded-opentype'),
- url('install.php?tmpFilePrefix={@TMP_FILE_PREFIX}&showFont=fontawesome-webfont.ttf') format('truetype');
- font-weight: normal;
- font-style: normal;
- }
- </style>
- {/if}
+ <style type="text/css">
+ @font-face {
+ font-family: 'FontAwesome';
+ src: url('{$setupAssets['fontawesome-webfont.woff2']}') format('woff2');
+ font-weight: normal;
+ font-style: normal;
+ }
+ </style>
<style type="text/css">
#pageHeaderContainer {
<div id="pageHeaderFacade" class="pageHeaderFacade">
<div class="layoutBoundary">
<div id="pageHeaderLogo" class="pageHeaderLogo">
- <img src="{if $lastStep|isset}{@RELATIVE_WCF_DIR}acp/images/{else}install.php?tmpFilePrefix={@TMP_FILE_PREFIX}&showImage={/if}woltlabSuite.png" alt="" style="height: 40px; width: 281px;">
+ <img src="{$setupAssets['woltlabSuite.png']}" alt="" style="height: 40px; width: 281px;">
</div>
</div>
</div>