mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
Remove excess dots from filenames #1251
This commit is contained in:
parent
f5f2cd99e0
commit
2284fb7128
2 changed files with 3 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ class FilenameFilter
|
|||
// Remove excess spaces and replacement characters.
|
||||
$filename = trim($filename, ' .-_');
|
||||
$filename = preg_replace('/__+/', '_', $filename);
|
||||
$filename = preg_replace('/\.\.+/', '.', $filename);
|
||||
|
||||
// Clean up unnecessary encodings.
|
||||
$filename = strtr($filename, array('&' => '&'));
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ class fileController extends file
|
|||
// Use short URL or long URL
|
||||
if ($file_module_config->download_short_url === 'Y' && config('use_rewrite'))
|
||||
{
|
||||
$url = RX_BASEURL . sprintf('files/download/%d/%s/%s', $file_srl, $file_key, rawurlencode($filename));
|
||||
$url = RX_BASEURL . sprintf('files/download/%d/%s/%s', $file_srl, $file_key, rawurlencode(preg_replace('/\.\.+/', '.', $filename)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -411,7 +411,7 @@ class fileController extends file
|
|||
$file_obj = $oFileModel->getFile($file_srl, $columnList);
|
||||
$file_config = $oFileModel->getFileConfig($file_obj->module_srl ?: null);
|
||||
$filesize = $file_obj->file_size;
|
||||
$filename = $file_obj->source_filename;
|
||||
$filename = preg_replace('/\.\.+/', '.', $file_obj->source_filename);
|
||||
$etag = md5($file_srl . $file_key . \RX_CLIENT_IP);
|
||||
|
||||
// Check file key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue