mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
fixed strange bug (corrupt file-ending at get_cm_js())
This commit is contained in:
parent
77f05c0e33
commit
57b3da4514
@ -437,24 +437,18 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
function get_cm_js()
|
function get_cm_js()
|
||||||
{
|
{
|
||||||
$this->load->helper('file');
|
|
||||||
$lang = $this->uri->segment(3);
|
$lang = $this->uri->segment(3);
|
||||||
$this->load->config('codemirror_languages');
|
$this->load->config('codemirror_languages');
|
||||||
$cml = $this->config->item('codemirror_languages');
|
$cml = $this->config->item('codemirror_languages');
|
||||||
|
|
||||||
if (isset($cml[$lang]) && gettype($cml[$lang]) == 'array')
|
if (isset($cml[$lang]) && gettype($cml[$lang]) == 'array')
|
||||||
{
|
{
|
||||||
$content = '';
|
header('Content-Type: application/x-javascript; charset=utf-8');
|
||||||
$total_size = 0;
|
|
||||||
foreach ($cml[$lang]['js'] as $js)
|
foreach ($cml[$lang]['js'] as $js)
|
||||||
{
|
{
|
||||||
$content.= file_get_contents('./static/js/' . $js[0]);
|
echo file_get_contents('./static/js/' . $js[0]);
|
||||||
$f = get_file_info('./static/js/' . $js[0]);
|
|
||||||
$total_size = $total_size + $f['size'];
|
|
||||||
}
|
}
|
||||||
header('Content-Type: application/x-javascript; charset=utf-8');
|
|
||||||
header('Content-length: ' . $total_size);
|
|
||||||
echo $content;
|
|
||||||
}
|
}
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//codemirror modes
|
//codemirror modes
|
||||||
echo '<div style="display: none;" id="codemirror_modes">' . json_encode($codemirror_modes) . '</div>';
|
if(isset($codemirror_modes){
|
||||||
|
echo '<div style="display: none;" id="codemirror_modes">' . json_encode($codemirror_modes) . '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
//stats
|
//stats
|
||||||
$this->load->view('defaults/stats');
|
$this->load->view('defaults/stats');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user