-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Security: Rename htaccess file by replacing case-insensitively
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,15 +30,17 @@ function php2phps($file_name) | |
} | ||
|
||
/** | ||
* Renames .htaccess & .HTACCESS to htaccess.txt. | ||
* Renames .htaccess & .HTACCESS & .htAccess to htaccess.txt. | ||
* | ||
* @param string $filename | ||
* | ||
* @return string | ||
*/ | ||
function htaccess2txt($filename) | ||
{ | ||
return str_replace(['.htaccess', '.HTACCESS'], ['htaccess.txt', 'htaccess.txt'], $filename); | ||
$filename = strtolower($filename); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NicoDucou
Member
|
||
|
||
return str_replace('.htaccess', 'htaccess.txt', $filename); | ||
} | ||
|
||
/** | ||
|
@AngelFQC
This "strtolower" generates many problem because the function htaccess2txt is called by "disable_dangerous_file" which is passed to all files, so all the files and directory on the plateform became lowercase. Which causes problem when importing a scorm for example that contains sub folder with capital letters and hard link in the HTML files of the scorm (Refs BT#21023.
It also generates problem when reimporting a course that has Capital letters in the folders so the path do not work anymore when reimporting. See issue #4872