diff options
author | Derek Jones <derek.jones@ellislab.com> | 2010-10-07 00:51:59 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2010-10-07 00:51:59 +0200 |
commit | 2ef375969b77c5fdf84118d4a7a8e0bc97d9d2f6 (patch) | |
tree | c9a3a7f9c53d3cd0392c982e6fb54e992c40eb65 /user_guide/libraries | |
parent | 2615e418539c3d6e2f912c66be99ffebfb8513ff (diff) |
modified the security helper to assist in preventing directory traversal when using sanitize_filename() for user input
Diffstat (limited to 'user_guide/libraries')
-rw-r--r-- | user_guide/libraries/security.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index a50d94846..6d6216d95 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -102,6 +102,11 @@ Note: This function should only be used to deal with data upon submission. It's <code>$filename = $this->security->sanitize_filename($this->input->post('filename'));</code> +<p>If it is acceptable for the user input to include relative paths, e.g. <kbd>file/in/some/approved/folder.txt</kbd>, you can set the second optional parameter, + <samp>$relative_path</samp> to TRUE.</p> + +<code>$filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);</code> + <!-- @todo write docs for CSRF methods --> </div> |