Index: branches/5.0.x/core/units/helpers/cat_dbitem_export_helper.php =================================================================== diff -u -r12343 -r12511 --- branches/5.0.x/core/units/helpers/cat_dbitem_export_helper.php (.../cat_dbitem_export_helper.php) (revision 12343) +++ branches/5.0.x/core/units/helpers/cat_dbitem_export_helper.php (.../cat_dbitem_export_helper.php) (revision 12511) @@ -1,6 +1,6 @@ exportOptions['IsBaseCategory'] ) { $sql = 'SELECT ParentPath FROM '.TABLE_PREFIX.'Category - WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'); + WHERE CategoryId = ' . (int)$this->Application->GetVar('m_cat_id'); $parent_path = $this->Conn->GetOne($sql); $parent_path = explode('|', substr($parent_path, 1, -1)); if ($parent_path && $parent_path[0] == $this->Application->findModule('Name', 'Core', 'RootCat')) { @@ -760,7 +760,7 @@ // get category id from database by name $sql = 'SELECT CategoryId FROM '.TABLE_PREFIX.'Category - WHERE ('.$lang_prefix.'Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.$current_category_id.')'; + WHERE ('.$lang_prefix.'Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.(int)$current_category_id.')'; $category_id = $this->Conn->GetOne($sql); if ($category_id === false) { @@ -824,10 +824,16 @@ if (count($load_keys)) { $where_clause = ''; + $language_id = (int)$this->Application->GetVar('m_lang'); + + if (!$language_id) { + $language_id = 1; + } + foreach ($load_keys as $field_name => $field_value) { if (preg_match('/^cust_(.*)/', $field_name, $regs)) { $custom_id = array_search($regs[1], $this->customFields); - $field_name = 'l'.$this->Application->GetVar('m_lang').'_cust_'.$custom_id; + $field_name = 'l'.$language_id.'_cust_'.$custom_id; $where_clause .= '(custom_data.`'.$field_name.'` = '.$this->Conn->qstr($field_value).') AND '; } else {