From 2ef375969b77c5fdf84118d4a7a8e0bc97d9d2f6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 6 Oct 2010 17:51:59 -0500 Subject: modified the security helper to assist in preventing directory traversal when using sanitize_filename() for user input --- user_guide/libraries/security.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'user_guide') 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 $filename = $this->security->sanitize_filename($this->input->post('filename')); +

If it is acceptable for the user input to include relative paths, e.g. file/in/some/approved/folder.txt, you can set the second optional parameter, + $relative_path to TRUE.

+ +$filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE); + -- cgit v1.2.3-24-g4f1b