mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
fonts
This commit is contained in:
parent
da3b080dfa
commit
18ef419bd8
@ -26,8 +26,61 @@ class Theme_assets extends CI_Controller
|
||||
$css_file = $this->uri->segment(4);
|
||||
$css_file = basename($css_file); // Fix LFI Vulnerability
|
||||
|
||||
//file path
|
||||
|
||||
if ($css_file == 'fonts')
|
||||
{
|
||||
$font_file = $this->uri->segment(5);
|
||||
$font_file = basename($font_file);
|
||||
echo $font_file;
|
||||
|
||||
//file path
|
||||
$file_path = 'themes/' . $this->theme . '/css/fonts/' . $font_file;
|
||||
|
||||
if (!file_exists($file_path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$path_parts = pathinfo(dirname(dirname(dirname(__FILE__))) . '/' . $file_path);
|
||||
|
||||
if ($path_parts['extension'] == "woff")
|
||||
{
|
||||
header('Content-type: application/font-woff');
|
||||
}
|
||||
|
||||
if ($path_parts['extension'] == "eot")
|
||||
{
|
||||
header('Content-type: application/vnd.ms-fontobject');
|
||||
}
|
||||
|
||||
if ($path_parts['extension'] == "ttf" || $path_parts['extension'] == "ttc")
|
||||
{
|
||||
header('Content-type: application/x-font-ttf');
|
||||
}
|
||||
|
||||
if ($path_parts['extension'] == "otf")
|
||||
{
|
||||
header('Content-type: font/opentype');
|
||||
}
|
||||
|
||||
if ($path_parts['extension'] == "svg")
|
||||
{
|
||||
header('Content-type: image/svg+xml');
|
||||
}
|
||||
|
||||
if ($path_parts['extension'] == "svgz")
|
||||
{
|
||||
header("Content-Encoding: gzip");
|
||||
header('Content-type: image/svg+xml');
|
||||
}
|
||||
|
||||
//send
|
||||
$this->_expires_header(1);
|
||||
readfile($file_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//file path
|
||||
$file_path = 'themes/' . $this->theme . '/css/' . $css_file;
|
||||
|
||||
//fallback to default css if view in theme not found
|
||||
@ -49,6 +102,7 @@ class Theme_assets extends CI_Controller
|
||||
$this->_expires_header(1);
|
||||
readfile($file_path);
|
||||
}
|
||||
}
|
||||
|
||||
function fonts()
|
||||
{
|
||||
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
@ -17,8 +17,8 @@ $page_title .= $this->config->item('site_name');
|
||||
|
||||
//Carabiner
|
||||
$this->carabiner->config(array(
|
||||
'script_dir' => 'themes/bootstrap/js/',
|
||||
'style_dir' => 'themes/bootstrap/css/',
|
||||
'script_dir' => 'themes/i386/js/',
|
||||
'style_dir' => 'themes/i386/css/',
|
||||
'cache_dir' => 'static/asset/',
|
||||
'base_uri' => base_url(),
|
||||
'combine' => true,
|
||||
@ -44,7 +44,7 @@ $searchparams = ($this->input->get('search') ? '?search=' . $this->input->get('s
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
|
Loading…
x
Reference in New Issue
Block a user