Reputation: 63
I'm making a website with codeigniter.
If a user writes {memory_usage}
in his comment 2.75MB
will be shown to him. doesn't it bring security vulnerability to codes written by codeigniter? Any reasonable(and common) way to prevent such problem?
Upvotes: 3
Views: 603
Reputation: 6353
Add this to your controller:
$this->output->parse_exec_vars = FALSE;
Parsing Execution Variables
CodeIgniter will parse the pseudo-variables
{elapsed_time}
and{memory_usage}
in your output by default. To disable this, set the$parse_exec_vars
class property toFALSE
in your controller.
Update, you may need to modify a core file in /system/core/Output.php
Change:
protected $parse_exec_vars = TRUE;
To:
public $parse_exec_vars = TRUE;
Now you will be able to set $this->output->parse_exec_vars
to FALSE
in your controller.
Upvotes: 2