Commit 36780561 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4900 (Editing theme images outside the root theme image directory fails)

parent ddeba20c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1964,7 +1964,7 @@ class Module_admin_themes
        if ((strpos($id, '/') !== false) && (str_replace(array('on', 'true', 'yes'), array('1', '1', '1'), strtolower(ini_get('safe_mode'))) != '1')) {
            $target_dir .= '/' . dirname($id);
        }
        $path = get_url('path', 'file', $target_dir, 0, CMS_UPLOAD_ANYTHING, false, '', '', false, false, false, false, null, null, null, $id . '.XXX');
        $path = get_url('path', 'file', $target_dir, 0, CMS_UPLOAD_ANYTHING, false, '', '', false, false, false, false, null, null, null, basename($id) . '.XXX');
        if ($path[0] == '') {
            return warn_screen($this->title, do_lang_tempcode('IMPROPERLY_FILLED_IN_UPLOAD'));
        }
@@ -2169,7 +2169,7 @@ class Module_admin_themes
                    $target_dir .= '/' . dirname($id);
                }
            }
            $path = get_url('path', 'file', $target_dir, 0, CMS_UPLOAD_ANYTHING, false, '', '', false, false, false, false, null, null, null, $id . '.XXX');
            $path = get_url('path', 'file', $target_dir, 0, CMS_UPLOAD_ANYTHING, false, '', '', false, false, false, false, null, null, null, basename($id . '.XXX'));

            if ((url_is_local($path[0])) && (!file_exists(((substr($path[0], 0, 15) == 'themes/default/') ? get_file_base() : get_custom_file_base()) . '/' . rawurldecode($path[0])))) {
                warn_screen($this->title, do_lang_tempcode('IMPROPERLY_FILLED_IN_UPLOAD'));