summaryrefslogtreecommitdiffstats
path: root/system/libraries/Security.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2010-10-07 16:31:40 +0200
committerDerek Jones <derek.jones@ellislab.com>2010-10-07 16:31:40 +0200
commitaa7d3f9c04c165f6514aff58596ad7cff89ebe65 (patch)
tree45dcf3255ecdbf74965a844e7e66a8aac560cdd7 /system/libraries/Security.php
parentdd6719738936be31cdaa1758ca86d5eb14dcab3d (diff)
parent124ac667046bfb662f4165934d953c0c8bded284 (diff)
Automated merge with https://bitbucket.org/barrymieny/codeigniter
Diffstat (limited to 'system/libraries/Security.php')
-rw-r--r--system/libraries/Security.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/system/libraries/Security.php b/system/libraries/Security.php
index 2db8ee9b3..fa5317ea3 100644
--- a/system/libraries/Security.php
+++ b/system/libraries/Security.php
@@ -680,11 +680,10 @@ class CI_Security {
* @param string
* @return string
*/
- function sanitize_filename($str)
+ function sanitize_filename($str, $relative_path = FALSE)
{
$bad = array(
"../",
- "./",
"<!--",
"-->",
"<",
@@ -701,7 +700,6 @@ class CI_Security {
'=',
';',
'?',
- '/',
"%20",
"%22",
"%3c", // <
@@ -717,6 +715,12 @@ class CI_Security {
"%3b", // ;
"%3d" // =
);
+
+ if ( ! $relative_path)
+ {
+ $bad[] = './';
+ $bad[] = '/';
+ }
return stripslashes(str_replace($bad, '', $str));
}