A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: main.php - Stikked
From Serkan Kuyu, 6 Years ago, written in PHP.
This paste is a reply to main.php from Claude - go back
Embed
Viewing differences between main.php and Re: main.php
<?php
/**
 
<?php
/**
 
* Class and Function List:
 
List:
 
* Function list:
 
list:
 
* - __construct()
 
__construct()
 
* - _form_prep()
 
_form_prep()
 
* - index()
 
index()
 
* - raw()
 
raw()
 
* - download()
 
download()
 
* - lists()
 
lists()
 
* - view()
 
view()
 
* - _view_options_prep()
 
_view_options_prep()
 
* - view_options()
 
view_options()
 
* - cron()
 
cron()
 
* - about()
 
about()
 
* - _valid_lang()
 
_valid_lang()
 
* Classes list:
 
list:
 
* - Main extends CI_Controller
 */

CI_Controller
 * - Main extends Siyahpapyon Controller
 */

class Main extends CI_Controller
{
        
        
CI_Controller
{
        
        
function __construct() 
        {
                parent::__construct();
                $this->load->model('languages');
                
                
__construct() 
        {
                parent::__construct();
                $this->load->model('languages');
                
                
if (!$this->db->table_exists('ci_sessions')) 
                {
                        $this->load->dbforge();
                        
(!$this->db->table_exists('ci_sessions')) 
                {
                        $this->load->dbforge();
                        
$fields = array(
                                
array(
                                
'session_id' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 40,
                                        
40,
                                        
'default' => 0,
                                
0,
                                
,
                                
,
                                
'ip_address' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 16,
                                        
16,
                                        
'default' => 0,
                                
0,
                                
,
                                
,
                                
'user_agent' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 50,
                                
50,
                                
,
                                
,
                                
'last_activity' => array(
                                        
array(
                                        
'type' => 'INT',
                                        
'INT',
                                        
'constraint' => 10,
                                        
10,
                                        
'unsigned' => TRUE,
                                        
TRUE,
                                        
'default' => 0,
                                
0,
                                
,
                                
,
                                
'session_data' => array(
                                        
array(
                                        
'type' => 'TEXT',
                                
'TEXT',
                                
,
                        );
                        $this->dbforge->add_field($fields);
                        
,
                        );
                        $this->dbforge->add_field($fields);
                        
$this->dbforge->add_key('session_id', true);
                        
true);
                        
$this->dbforge->create_table('ci_sessions', true);
                }
                
                
true);
                }
                
                
if (!$this->db->table_exists('pastes')) 
                {
                        $this->load->dbforge();
                        
(!$this->db->table_exists('pastes')) 
                {
                        $this->load->dbforge();
                        
$fields = array(
                                
array(
                                
'id' => array(
                                        
array(
                                        
'type' => 'INT',
                                        
'INT',
                                        
'constraint' => 10,
                                        
10,
                                        
'auto_increment' => TRUE,
                                
TRUE,
                                
,
                                
,
                                
'pid' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 8,
                                
8,
                                
,
                                
,
                                
'title' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 32,
                                
32,
                                
,
                                
,
                                
'name' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 32,
                                
32,
                                
,
                                
,
                                
'lang' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 32,
                                
32,
                                
,
                                
,
                                
'private' => array(
                                        
array(
                                        
'type' => 'TINYINT',
                                        
'TINYINT',
                                        
'constraint' => 1,
                                
1,
                                
,
                                
,
                                
'paste' => array(
                                        
array(
                                        
'type' => 'LONGTEXT',
                                
'LONGTEXT',
                                
,
                                
,
                                
'raw' => array(
                                        
array(
                                        
'type' => 'LONGTEXT',
                                
'LONGTEXT',
                                
,
                                
,
                                
'created' => array(
                                        
array(
                                        
'type' => 'INT',
                                        
'INT',
                                        
'constraint' => 10,
                                
10,
                                
,
                                
,
                                
'expire' => array(
                                        
array(
                                        
'type' => 'INT',
                                        
'INT',
                                        
'constraint' => 10,
                                        
10,
                                        
'default' => 0,
                                
0,
                                
,
                                
,
                                
'toexpire' => array(
                                        
array(
                                        
'type' => 'TINYINT',
                                        
'TINYINT',
                                        
'constraint' => 1,
                                        
1,
                                        
'unsigned' => TRUE,
                                
TRUE,
                                
,
                                
,
                                
'snipurl' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 64,
                                        
64,
                                        
'default' => 0,
                                
0,
                                
,
                                
,
                                
'replyto' => array(
                                        
array(
                                        
'type' => 'VARCHAR',
                                        
'VARCHAR',
                                        
'constraint' => 8,
                                
8,
                                
,
                        );
                        $this->dbforge->add_field($fields);
                        
,
                        );
                        $this->dbforge->add_field($fields);
                        
$this->dbforge->add_key('id', true);
                        
true);
                        
$this->dbforge->create_table('pastes', true);
                }
        }
        
        
true);
                }
        }
        
        
function _form_prep($lang = 'php', $title = '', $paste = '', $reply = false) 
        {
                $this->load->model('languages');
                $this->load->helper('form');
                
false) 
        {
                $this->load->model('languages');
                $this->load->helper('form');
                
$data['languages'] = $this->languages->get_languages();
                
                
$this->languages->get_languages();
                
                
if (!$this->input->post('submit')) 
                {
                        
                        
(!$this->input->post('submit')) 
                {
                        
                        
if ($this->db_session->flashdata('settings_changed')) 
                        {
                                
($this->db_session->flashdata('settings_changed')) 
                        {
                                
$data['status_message'] = 'Settings successfully changed';
                        }
                        
changed';
                        }
                        
$data['name_set'] = $this->db_session->userdata('name');
                        
$this->db_session->userdata('name');
                        
$data['expire_set'] = $this->db_session->userdata('expire');
                        
$this->db_session->userdata('expire');
                        
$data['acopy_set'] = $this->db_session->userdata('acopy');
                        
$this->db_session->userdata('acopy');
                        
$data['private_set'] = $this->db_session->userdata('private');
                        
$this->db_session->userdata('private');
                        
$data['snipurl_set'] = $this->db_session->userdata('snipurl');
                        
$this->db_session->userdata('snipurl');
                        
$data['remember_set'] = $this->db_session->userdata('remember');
                        
$this->db_session->userdata('remember');
                        
$data['paste_set'] = $paste;
                        
$paste;
                        
$data['title_set'] = $title;
                        
$title;
                        
$data['reply'] = $reply;
                        
                        
$reply;
                        
                        
if ($lang != 'php' or ($lang == 'php' and $this->db_session->userdata('lang') == false)) 
                        {
                                
false)) 
                        {
                                
$data['lang_set'] = $lang;
                        }
                        
$lang;
                        }
                        
elseif ($this->db_session->userdata('lang')) 
                        {
                                
($this->db_session->userdata('lang')) 
                        {
                                
$data['lang_set'] = $this->db_session->userdata('lang');
                        }
                }
                else
                {
                        
$this->db_session->userdata('lang');
                        }
                }
                else
                {
                        
$data['name_set'] = $this->input->post('name');
                        
$this->input->post('name');
                        
$data['expire_set'] = $this->input->post('expire');
                        
$this->input->post('expire');
                        
$data['acopy_set'] = $this->input->post('acopy');
                        
$this->input->post('acopy');
                        
$data['private_set'] = $this->input->post('private');
                        
$this->input->post('private');
                        
$data['snipurl_set'] = $this->input->post('snipurl');
                        
$this->input->post('snipurl');
                        
$data['remember_set'] = $this->input->post('remember');
                        
$this->input->post('remember');
                        
$data['paste_set'] = $this->input->post('paste');
                        
$this->input->post('paste');
                        
$data['title_set'] = $this->input->post('title');
                        
$this->input->post('title');
                        
$data['reply'] = $this->input->post('reply');
                        
$this->input->post('reply');
                        
$data['lang_set'] = $this->input->post('lang');
                }
                
$this->input->post('lang');
                }
                
return $data;
        }
        
        
$data;
        }
        
        
function index() 
        {
                
                
index() 
        {
                
                
if (!$this->input->post('submit')) 
                {
                        
(!$this->input->post('submit')) 
                {
                        
$data = $this->_form_prep();
                        
$this->_form_prep();
                        
$this->load->view('home', $data);
                }
                else
                {
                        $this->load->model('pastes');
                        $this->load->library('form_validation');

                        //rules
                        
$data);
                }
                else
                {
                        $this->load->model('pastes');
                        $this->load->library('form_validation');

                        //rules
                        
$rules = array(
                                array(
                                        
array(
                                array(
                                        
'field' => 'code',
                                        
'code',
                                        
'label' => 'Main Paste',
                                        
Paste',
                                        
'rules' => 'required',
                                
'required',
                                
,
                                array(
                                        
,
                                array(
                                        
'field' => 'lang',
                                        
'lang',
                                        
'label' => 'Language',
                                        
'Language',
                                        
'rules' => 'min_length[1]|required|callback__valid_lang',
                                
'min_length[1]|required|callback__valid_lang',
                                
,
                        );

                        
,
                        );

                        
//form validation
                        $this->form_validation->set_rules($rules);
                        
validation
                        $this->form_validation->set_rules($rules);
                        
$this->form_validation->set_message('min_length', 'The %s field can not be empty');
                        
empty');
                        
$this->form_validation->set_error_delimiters('<div class="message error"><div class="container">', '</div></div>');
                        
                        
'</div></div>');
                        
                        
if ($this->form_validation->run() == FALSE) 
                        {
                                
FALSE) 
                        {
                                
$data = $this->_form_prep();
                                
$this->_form_prep();
                                
$this->load->view('home', $data);
                        }
                        else
                        {
                                
                                
$data);
                        }
                        else
                        {
                                
                                
if ($this->input->post('acopy')) 
                                {
                                        
($this->input->post('acopy')) 
                                {
                                        
$this->db_session->set_flashdata('acopy', 'true');
                                }
                                
                                
'true');
                                }
                                
                                
if ($this->input->post('remember') and $this->input->post('reply') == false) 
                                {
                                        
false) 
                                {
                                        
$user_data = array(
                                                
array(
                                                
'name' => $this->input->post('name') ,
                                                
,
                                                
'lang' => $this->input->post('lang') ,
                                                
,
                                                
'expire' => $this->input->post('expire') ,
                                                
,
                                                
'acopy' => $this->input->post('acopy') ,
                                                
,
                                                
'snipurl' => $this->input->post('snipurl') ,
                                                
,
                                                
'private' => $this->input->post('private') ,
                                                
,
                                                
'remember' => $this->input->post('remember')
                                        );
                                        $this->db_session->set_userdata($user_data);
                                }
                                
                                
$this->input->post('remember')
                                        );
                                        $this->db_session->set_userdata($user_data);
                                }
                                
                                
if ($this->input->post('remember') == false and $this->db_session->userdata("remember") == 1) 
                                {
                                        
1) 
                                {
                                        
$user_data = array(
                                                
array(
                                                
'name' => '',
                                                
'',
                                                
'lang' => 'php',
                                                
'php',
                                                
'expire' => '0',
                                                
'0',
                                                
'acopy' => '0',
                                                
'0',
                                                
'snipurl' => '0',
                                                
'0',
                                                
'private' => '0',
                                                
'0',
                                                
'remember' => '0'
                                        );
                                        $this->db_session->unset_userdata($user_data);
                                }
                                redirect($this->pastes->createPaste());
                        }
                }
        }
        
        
'0'
                                        );
                                        $this->db_session->unset_userdata($user_data);
                                }
                                redirect($this->pastes->createPaste());
                        }
                }
        }
        
        
function raw() 
        {
                $this->load->model('pastes');
                
raw() 
        {
                $this->load->model('pastes');
                
$check = $this->pastes->checkPaste(3);
                
                
$this->pastes->checkPaste(3);
                
                
if ($check) 
                {
                        
($check) 
                {
                        
$data = $this->pastes->getPaste(3);
                        
$this->pastes->getPaste(3);
                        
$this->load->view('view/raw', $data);
                }
                else
                {
                        show_404();
                }
        }
        
        
$data);
                }
                else
                {
                        show_404();
                }
        }
        
        
function download() 
        {
                $this->load->model('pastes');
                
download() 
        {
                $this->load->model('pastes');
                
$check = $this->pastes->checkPaste(3);
                
                
$this->pastes->checkPaste(3);
                
                
if ($check) 
                {
                        
($check) 
                {
                        
$data = $this->pastes->getPaste(3);
                        
$this->pastes->getPaste(3);
                        
$this->load->view('view/download', $data);
                }
                else
                {
                        show_404();
                }
        }
        
        
$data);
                }
                else
                {
                        show_404();
                }
        }
        
        
function lists() 
        {
                $this->load->model('pastes');
                
lists() 
        {
                $this->load->model('pastes');
                
$data = $this->pastes->getLists();
                
$this->pastes->getLists();
                
$this->load->view('list', $data);
        }
        
        
$data);
        }
        
        
function view() 
        {
                $this->load->model('pastes');
                
view() 
        {
                $this->load->model('pastes');
                
$check = $this->pastes->checkPaste(2);
                
                
$this->pastes->checkPaste(2);
                
                
if ($check) 
                {
                        
                        
($check) 
                {
                        
                        
if ($this->db_session->userdata('view_raw')) 
                        {
                                $this->db_session->keep_flashdata('acopy');
($this->db_session->userdata('view_raw')) 
                        {
                                $this->db_session->keep_flashdata('acopy');
                                redirect('view/raw/' . $this->uri->segment(2));
                        }
                        
$this->uri->segment(2));
                        }
                        
$data = $this->pastes->getPaste(2, true);
true);
                        $data['reply_form'] = $this->_form_prep($data['lang_code'], "RE: " . $data['title'], $data['raw'], $data['pid']);
                        
                        
$data['pid']);
                        
                        
if ($this->db_session->userdata('full_width')) 
                        {
                                
($this->db_session->userdata('full_width')) 
                        {
                                
$data['full_width'] = true;
                        }
                        else
                        {
                                
true;
                        }
                        else
                        {
                                
$data['full_width'] = false;
                        }
                        
false;
                        }
                        
$this->load->view('view/view', $data);
                }
                else
                {
                        show_404();
                }
        }
        
        
$data);
                }
                else
                {
                        show_404();
                }
        }
        
        
function _view_options_prep() 
        {
                $this->load->helper('form');
                
                
_view_options_prep() 
        {
                $this->load->helper('form');
                
                
if ($this->db_session->userdata('remember_view') > 0) 
                {
                        
0) 
                {
                        
$data['full_width_set'] = $this->db_session->userdata('full_width');
                        
$this->db_session->userdata('full_width');
                        
$data['view_raw_set'] = $this->db_session->userdata('view_raw');
                }
                else
                {
                        
$this->db_session->userdata('view_raw');
                }
                else
                {
                        
$data['full_width_set'] = false;
                        
false;
                        
$data['view_raw_set'] = false;
                }
                
false;
                }
                
return $data;
        }
        
        
$data;
        }
        
        
function view_options() 
        {
                
                
view_options() 
        {
                
                
if (!$this->input->post('submit')) 
                {
                        
(!$this->input->post('submit')) 
                {
                        
$data = $this->_view_options_prep();
                        
$this->_view_options_prep();
                        
$this->load->view('view/view_options', $data);
                }
                else
                {
                        $this->load->library('form_validation');
                        
$data);
                }
                else
                {
                        $this->load->library('form_validation');
                        
$rules = array(
                                array(
                                        
array(
                                array(
                                        
'field' => 'full_width',
                                        
'full_width',
                                        
'label' => 'full_width',
                                        
'full_width',
                                        
'rules' => 'max_length[1]',
                                
'max_length[1]',
                                
,
                                array(
                                        
,
                                array(
                                        
'field' => 'view_raw',
                                        
'view_raw',
                                        
'label' => 'view_raw',
                                        
'view_raw',
                                        
'rules' => 'max_length[1]',
                                
'max_length[1]',
                                
,
                        );
                        $this->form_validation->set_rules($rules);
                        
                        
,
                        );
                        $this->form_validation->set_rules($rules);
                        
                        
if ($this->form_validation->run() == false) 
                        {
false) 
                        {
                                exit('Ugh, stupid skiddie.');
                        }
                        else
                        {
                                
');
                        }
                        else
                        {
                                
$user_data = array(
                                        
array(
                                        
'full_width' => $this->input->post('full_width') ,
                                        
,
                                        
'view_raw' => $this->input->post('view_raw') ,
                                        
,
                                        
'remember_view' => true
                                );
                                $this->db_session->set_userdata($user_data);
                                
true
                                );
                                $this->db_session->set_userdata($user_data);
                                
$this->db_session->set_flashdata('settings_changed', 'true');
                                redirect();
                        }
                }
        }
        
        
'true');
                                redirect();
                        }
                }
        }
        
        
function cron() 
        {
                $this->load->model('pastes');
                
cron() 
        {
                $this->load->model('pastes');
                
$key = $this->uri->segment(2);
                
                
$this->uri->segment(2);
                
                
if ($key != $this->config->item('cron_key')) 
                {
                        show_404();
                }
                else
                {
                        $this->pastes->cron();
                        
$this->config->item('cron_key')) 
                {
                        show_404();
                }
                else
                {
                        $this->pastes->cron();
                        
return 0;
                }
        }
        
        
0;
                }
        }
        
        
function about() 
        {
                $this->load->view('about');
        }
        
        
about() 
        {
                $this->load->view('about');
        }
        
        
function _valid_lang($lang) 
        {
                $this->load->model('languages');
                
_valid_lang($lang) 
        {
                $this->load->model('languages');
                
$this->form_validation->set_message('_valid_lang', 'Please select your language');
                
language');
                
return $this->languages->valid_language($lang);
        }
}
$this->languages->valid_language($lang);
        }
}