Skip to content

Commit dc7bfce

Browse files
committed
Security: Rename htaccess file by replacing case-insensitively
1 parent 3650e44 commit dc7bfce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main/inc/lib/fileUpload.lib.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ function php2phps($file_name)
3030
}
3131

3232
/**
33-
* Renames .htaccess & .HTACCESS to htaccess.txt.
33+
* Renames .htaccess & .HTACCESS & .htAccess to htaccess.txt.
3434
*
3535
* @param string $filename
3636
*
3737
* @return string
3838
*/
3939
function htaccess2txt($filename)
4040
{
41-
return str_replace(['.htaccess', '.HTACCESS'], ['htaccess.txt', 'htaccess.txt'], $filename);
41+
$filename = strtolower($filename);
42+
43+
return str_replace('.htaccess', 'htaccess.txt', $filename);
4244
}
4345

4446
/**

0 commit comments

Comments
 (0)