Index: branches/RC/core/units/categories/categories_item.php =================================================================== diff -u -N -r10780 -r10906 --- branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 10780) +++ branches/RC/core/units/categories/categories_item.php (.../categories_item.php) (revision 10906) @@ -53,7 +53,8 @@ return $parent_path.$this->GetID().'|'; } - + + /** * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result * @@ -62,16 +63,14 @@ */ function stripDisallowed($string) { - $not_allowed = Array( ' ', '\\', '/', ':', '*', '?', '"', '<', '>', '|', '`', - '~', '!', '@', '#', '$', '%', '^', '&', '(', ')', '~', - '+', '=', '-', '{', '}', ']', '[', "'", ';', '.', ','); + $filenames_helper =& $this->Application->recallObject('FilenamesHelper'); + /* @var $filenames_helper EFilenameHelper */ - $string = str_replace($not_allowed, '_', $string); - $string = preg_replace('/(_+)/', '_', $string); - $string = $this->checkAutoFilename($string); + $string = $filenames_helper->replaceSequences($string); - return $string; + return $this->checkAutoFilename($string); } + function checkFilename() { @@ -87,6 +86,8 @@ { if(!$filename) return $filename; + $escape_char = $this->Application->ConfigValue('FilenameSpecialCharReplacement'); + $item_id = !$this->GetID() ? 0 : $this->GetID(); $check_in_parent_cat_only = $item_id ? ' AND ParentId = '.$this->GetDBField("ParentId") : ''; @@ -105,11 +106,11 @@ $duplicates_found = (count($found_item_ids) > 1) || ($found_item_ids && $found_item_ids[0] != $item_id); if ($duplicates_found || $has_page) // other category has same filename as ours OR we have filename, that ends with _number { - $append = $duplicates_found ? '_a' : ''; + $append = $duplicates_found ? $escape_char . 'a' : ''; if($has_page) { $filename = $rets[1].'_'.$rets[2]; - $append = $rets[3] ? $rets[3] : '_a'; + $append = $rets[3] ? $rets[3] : $escape_char . 'a'; } // check live & temp table