Skip to content

Commit

Permalink
Implement fix for #3276 in 2.3/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Sturgeon committed Apr 24, 2014
1 parent 36a3aa1 commit af42c70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion installer/assets/config/config.php
Expand Up @@ -230,7 +230,7 @@
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = "Jiu348^&H%fa";
$config['encryption_key'] = '{encryption-key}';

/*
|--------------------------------------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion installer/libraries/Installer_lib.php
Expand Up @@ -293,13 +293,21 @@ public function write_db_file($db)
*/
public function write_config_file()
{
ci()->load->library('encrypt');

$server_name = ci()->session->userdata('http_server');
$supported_servers = ci()->config->item('supported_servers');

// Able to use clean URLs?
$index_page = ($supported_servers[$server_name]['rewrite_support'] !== false) ? '' : 'index.php';

return $this->_write_file_vars('../system/cms/config/config.php', './assets/config/config.php', array('{index}' => $index_page));
// Make some sort of random key to encrypt sessions, cookies, etc
$encryption_key = substr(ci()->encrypt->encode(str_shuffle(md5(time())), mt_rand()), 0, 42);

return $this->_write_file_vars('../system/cms/config/config.php', './assets/config/config.php', array(
'{index}' => $index_page,
'{encryption-key}' => $encryption_key,
));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion system/cms/config/config.php
Expand Up @@ -230,7 +230,7 @@
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = "Jiu348^&H%fa";
$config['encryption_key'] = '';

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit af42c70

Please sign in to comment.