htmlspecialchars() -.-

This commit is contained in:
Claude 2012-04-14 19:21:32 +02:00
parent 2513a0dc2d
commit 51f58c5710
5 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,7 @@ $config['geshi_languages'] = array(
'latex' => 'LaTeX', 'latex' => 'LaTeX',
'sql' => 'SQL', 'sql' => 'SQL',
'xml' => 'XML', 'xml' => 'XML',
'text' => 'Plaintext', 'text' => 'Plain Text',
'abap' => 'ABAP', 'abap' => 'ABAP',
'actionscript' => 'Actionscript', 'actionscript' => 'Actionscript',
'ada' => 'ADA', 'ada' => 'ADA',

View File

@ -46,7 +46,7 @@ class Main extends CI_Controller
$data['private_set'] = $this->db_session->userdata('private'); $data['private_set'] = $this->db_session->userdata('private');
$data['snipurl_set'] = $this->db_session->userdata('snipurl'); $data['snipurl_set'] = $this->db_session->userdata('snipurl');
$data['remember_set'] = $this->db_session->userdata('remember'); $data['remember_set'] = $this->db_session->userdata('remember');
$data['paste_set'] = htmlspecialchars($paste); $data['paste_set'] = $paste;
$data['title_set'] = $title; $data['title_set'] = $title;
$data['reply'] = $reply; $data['reply'] = $reply;

View File

@ -33,7 +33,9 @@ class Pastes extends CI_Model
$this->load->library('process'); $this->load->library('process');
$data['id'] = NULL; $data['id'] = NULL;
$data['created'] = time(); $data['created'] = time();
$data['raw'] = $this->input->post('code');
//this is SO evil… saving the «raw» data with htmlspecialchars :-( (but I have to leave this, because of backwards-compatibility)
$data['raw'] = htmlspecialchars($this->input->post('code'));
$data['lang'] = htmlspecialchars($this->input->post('lang')); $data['lang'] = htmlspecialchars($this->input->post('lang'));
$data['replyto'] = $this->input->post('reply'); $data['replyto'] = $this->input->post('reply');

View File

@ -2,4 +2,4 @@
header('Content-type: text/plain'); header('Content-type: text/plain');
header('Content-disposition: attachment'); header('Content-disposition: attachment');
//todo: nice filename header('Content-disposition: attachment;filename=' . $title . '.' . $lang_code); //todo: nice filename header('Content-disposition: attachment;filename=' . $title . '.' . $lang_code);
echo $raw; echo htmlspecialchars_decode($raw);

View File

@ -1,3 +1,3 @@
<?php <?php
header('Content-Type:text/plain; charset=utf-8'); header('Content-Type:text/plain; charset=utf-8');
echo $raw; echo htmlspecialchars_decode($raw);