mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Remove double extensions from filenames #2556
This commit is contained in:
parent
464985b1ef
commit
8291cd671e
2 changed files with 8 additions and 1 deletions
|
|
@ -34,6 +34,9 @@ class FilenameFilter
|
|||
$filename = preg_replace('/__+/', '_', $filename);
|
||||
$filename = preg_replace('/\.\.+/', '.', $filename);
|
||||
|
||||
// Remove potentially misleading double extensions.
|
||||
$filename = preg_replace('/\.(?:php[\d|s]?|txt|pdf|zip|com|exe|bat|msi|scr|jsp|aspx?|docx?|xlsx?|pptx?|hwpx?)\s?(\.[a-z0-9]+)$/', '$1', $filename);
|
||||
|
||||
// Change .php files to .phps to make them non-executable.
|
||||
if (strtolower(substr($filename, strlen($filename) - 4)) === '.php')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue