Why if i pass a $_POST['string'] = "<?php echo 'hey' ?>" then i pass it to the xss_clean() with echo $this->input->post('string',true); it is outputted as &lt;?php echo 'hey' ?&gt; and not as <?php echo 'hey' ?> ??
Why if i pass a $_POST[‘string’] = <?php echo ‘hey’ ?> then i pass
Share
If you take a look at the source code, you can see that the xss_clean method does a lot of heavy lifting. It’s more than just a
htmlspecialchars()call. If you’re wanting to display php code in a page, I would convert it first, then sanitize it.