diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-31 16:34:50 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-31 16:34:50 -0400 |
| commit | d692bce68674934a4af2e9cba79d65e72279b0a9 (patch) | |
| tree | 7832e3570d64cd9aca899351e5d8c2adbd403d49 /post.php | |
| parent | dc1d1a3fcd0e6a9e4f1ba791e15765d68b09e6dc (diff) | |
Fix issue #74. Note: This bug may break the display of certain filenames prior to upgrade.
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -284,7 +284,7 @@ if (isset($_POST['delete'])) { $post['has_file'] = !isset($post['embed']) && (($post['op'] && !isset($post['no_longer_require_an_image_for_op']) && $config['force_image_op']) || (isset($_FILES['file']) && $_FILES['file']['tmp_name'] != '')); if ($post['has_file']) - $post['filename'] = utf8tohtml(get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name']); + $post['filename'] = urldecode(get_magic_quotes_gpc() ? stripslashes($_FILES['file']['name']) : $_FILES['file']['name']); if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) { $stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']); @@ -347,7 +347,7 @@ if (isset($_POST['delete'])) { } else $noko = false; if ($post['has_file']) { - $post['extension'] = strtolower(substr($post['filename'], strrpos($post['filename'], '.') + 1)); + $post['extension'] = strtolower(mb_substr($post['filename'], mb_strrpos($post['filename'], '.') + 1)); if (isset($config['filename_func'])) $post['file_id'] = $config['filename_func']($post); else @@ -414,7 +414,7 @@ if (isset($_POST['delete'])) { $is_an_image = !in_array($post['extension'], $config['allowed_ext_files']); // Truncate filename if it is too long - $post['filename'] = substr($post['filename'], 0, $config['max_filename_len']); + $post['filename'] = mb_substr($post['filename'], 0, $config['max_filename_len']); $upload = $_FILES['file']['tmp_name']; |
