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?
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_varsclass property toFALSEin 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With