Merge pull request #2201 from xeptor/develop
Upload library, clean_file_name function: Fix xss bug.
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 96bb17e..1f0bd6a 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -1005,7 +1005,14 @@
'%3d' // =
);
- return stripslashes(str_replace($bad, '', $filename));
+ do
+ {
+ $old_filename = $filename;
+ $filename = str_replace($bad, '', $filename);
+ }
+ while ($old_filename !== $filename);
+
+ return stripslashes($filename);
}
// --------------------------------------------------------------------