PMCORE-2099

This commit is contained in:
Julio Cesar Laura Avendaño
2020-08-31 22:55:44 +00:00
parent 161d61822a
commit 12dfd1035e
3 changed files with 17 additions and 9 deletions

View File

@@ -9,16 +9,11 @@ $pathHome = implode('/', $sections) . '/';
// Include the "paths_installed.php" file
require_once $pathHome . 'engine/config/paths_installed.php';
// Set the fonts styles file
// Set the fonts styles file, for now the value is fixed (Maybe later we have another PDF engine)
$fileName = 'fonts.css';
// Check if the requested css file exists and if is accessible
if (!file_exists(PATH_DATA . 'fonts/tcpdf/' . $fileName)) {
// Redirect to error page 404
header('Location: /errors/error404.php');
die();
} else {
// Stream the font file
header('Content-Type: text/css');
// Stream the requested css file if exists and if is accessible
header('Content-Type: text/css');
if (file_exists(PATH_DATA . 'fonts/tcpdf/' . $fileName)) {
readfile(PATH_DATA . 'fonts/tcpdf/' . $fileName);
}