View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003440 | mantisbt | bugtracker | public | 2003-12-02 03:43 | 2004-02-29 07:20 |
| Reporter | hassan | Assigned To | vboctor | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 0.18.0a4 | ||||
| Summary | 0003440: "Allowed File Types" is case sensitive | ||||
| Description | I set my config.php file the way that it allows "zip" type files. It happened that for one of the bug i tried to upload "error.ZIP" file and it's rejected by the Mantis saying that file type not allowed. I simple changed the file name to "error.zip" and it worked. | ||||
| Additional Information | Mantis v0.18.0a4 | ||||
| Tags | No tags attached. | ||||
| Attached Files | 3440_allowed_disallowed_files_are_case_sensitive.diff (1,120 bytes)
Index: core/file_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/file_api.php,v
retrieving revision 1.40
diff -u -r1.40 file_api.php
--- core/file_api.php 11 Jan 2004 07:16:10 -0000 1.40
+++ core/file_api.php 8 Feb 2004 08:28:49 -0000
@@ -308,22 +308,24 @@
# check against disallowed files
$t_disallowed_arr = explode_enum_string( $t_disallowed_files );
foreach ( $t_disallowed_arr as $t_val ) {
- if ( $t_val == $t_extension ) {
- return false;
- }
+ if ( strcasecmp( $t_val, $t_extension ) == 0 ) {
+ return false;
+ }
}
# if the allowed list is note populated then the file must be allowed
if ( is_blank( $t_allowed_files ) ) {
return true;
}
+
# check against allowed files
$t_allowed_arr = explode_enum_string( $t_allowed_files );
foreach ( $t_allowed_arr as $t_val ) {
- if ( $t_val == $t_extension ) {
+ if ( strcasecmp( $t_val, $t_extension ) == 0 ) {
return true;
- }
+ }
}
+
return false;
}
# --------------------
| ||||