diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index c3e1b3a..167fe07 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -54,6 +54,7 @@ class Main extends CI_Controller ) , 'session_data' => array( 'type' => 'TEXT', + 'null' => TRUE, ) , ); $this->dbforge->add_field($fields); @@ -106,6 +107,7 @@ class Main extends CI_Controller 'type' => 'TINYINT', 'constraint' => 1, 'unsigned' => TRUE, + 'default' => 0, ) , 'snipurl' => array( 'type' => 'VARCHAR', diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index 9166d40..76515ba 100755 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -39,7 +39,6 @@ class Pastes extends CI_Model function createPaste() { - $data['id'] = NULL; $data['created'] = time(); //this is SO evil… saving the «raw» data with htmlspecialchars :-( (but I have to leave this, because of backwards-compatibility) @@ -94,7 +93,7 @@ class Pastes extends CI_Model if ($this->input->post('expire') == 0) { - $data['expire'] = '0000-00-00 00:00:00'; + $data['expire'] = 0; } else {