BUG : Config->set_item and config_item() internal use #180

Closed
bitbucket-import opened this Issue Aug 19, 2011 · 3 comments

Comments

Projects
None yet
3 participants

From a fresh install of 2.0.2 :

  1. Set the config item 'global_xss_filtering' to FALSE in config.php,
  2. In the welcome index function, write :

{{{

!php

public function index()
{
/*
* Normal CI way
*
* returns :
* boolean false
* boolean true
*/
$this->config->set_item('global_xss_filtering', TRUE);
var_dump(config_item('global_xss_filtering'));
var_dump($this->config->item('global_xss_filtering'));

/**
 * Trying to use the Common.php set_config() to "dynamically replace" the value.
 *
 * returns : 
 * boolean false
 * boolean true 
 */
get_config(array('global_xss_filtering' => TRUE));
var_dump(config_item('global_xss_filtering'));
var_dump($this->config->item('global_xss_filtering'));

$this->load->view('welcome_message');

}
}}}

The internal CI classes mostly use config_item() to get config_items.

Because the doc indicates that's it's possible to dynamically change a config item and because in fact it is not possible, is this a bug ?

Contributor

kenjis commented Aug 22, 2011

$this->config->set_item() does not change config_item()'s static var. it causes the different values.
This seems to be a bug.

kenjis pushed a commit to kenjis/CodeIgniter that referenced this issue Aug 28, 2011

Contributor

kenjis commented Sep 1, 2011

Dentxinho pushed a commit to Dentxinho/CodeIgniter that referenced this issue Sep 28, 2012

Merge pull request #180 from dominikkukacka/2
Added Manual Activation Switch
Contributor

narfbg commented Nov 4, 2012

@narfbg narfbg closed this Nov 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment