diff options
Diffstat (limited to 'phpBB/download')
-rw-r--r-- | phpBB/download/file.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c4d6c26152..a5d7eada3f 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -376,7 +376,11 @@ else $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); $clean_name = current($row); - $clean_name = rawurlencode(str_replace($bad_chars, '_', strtolower($clean_name))); + + // rawurlencode to convert any potentially 'bad' characters that we missed + $clean_name = rawurlencode(str_replace($bad_chars, '_', $clean_name)); + + // Turn the %xx entities created by rawurlencode to _ $clean_name = preg_replace("/%(\w{2})/", '_', $clean_name); $suffix = '_' . (($post_id) ? $post_id : $topic_id) . '_' . $clean_name; |