Index: core/units/helpers/image_helper.php =================================================================== --- core/units/helpers/image_helper.php +++ core/units/helpers/image_helper.php @@ -124,6 +124,13 @@ $src_path_escaped = preg_replace('/(\\\[\d]+)/', '\\\\\1', $src_path); // escape replacement patterns, like "\" $dst_image = preg_replace('/^'.preg_quote($src_path, '/').'(.*)\.(.*)$/', $src_path_escaped . DIRECTORY_SEPARATOR . 'resized\\1_' . crc32(serialize($params)) . '.\\2', $src_image); + // Keep resized version of theme-based images under "system" folder. + $theme_path = $this->Application->GetFrontThemePath(); + + if ( preg_match('/^' . preg_quote(FULL_PATH . $theme_path, '/') . '(.*)$/', $dst_image, $regs) ) { + $dst_image = WRITEABLE . $theme_path . $regs[1]; + } + $this->fileHelper->CheckFolder( dirname($dst_image) ); if (!file_exists($dst_image) || filemtime($src_image) > filemtime($dst_image)) {