Index: branches/5.2.x/core/units/helpers/file_helper.php =================================================================== diff -u -N -r14572 -r14585 --- branches/5.2.x/core/units/helpers/file_helper.php (.../file_helper.php) (revision 14572) +++ branches/5.2.x/core/units/helpers/file_helper.php (.../file_helper.php) (revision 14585) @@ -1,6 +1,6 @@ createUploadFields($prefix, $image_names, $is_image); + if ($created_count) { + $this->createUploadFields($prefix, $image_names, $is_image); + } + return ; } @@ -255,7 +258,7 @@ $result = true; if (!file_exists($path) || !is_dir($path)) { - $parent_path = preg_replace('#/[^/]+/?$#', '', $path); + $parent_path = preg_replace('#(/|\\\)[^/\\\]+(/|\\\)?$#', '', $path); $result = $this->CheckFolder($parent_path); if ($result) { @@ -390,8 +393,11 @@ function urlToPath($url) { $base_url = rtrim($this->Application->BaseURL(), '/'); - $path = preg_replace('/^' . preg_quote($base_url, '/') . '(.*)/', FULL_PATH . '\\1', $url); + // escape replacement patterns, like "\" + $full_path = preg_replace('/(\\\[\d]+)/', '\\\\\1', FULL_PATH); + $path = preg_replace('/^' . preg_quote($base_url, '/') . '(.*)/', $full_path . '\\1', $url, 1); + return str_replace('/', DIRECTORY_SEPARATOR, rawurldecode($path)); } } \ No newline at end of file