Index: branches/5.2.x/core/kernel/managers/rewrite_url_processor.php =================================================================== diff -u -N -r15165 -r15246 --- branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 15165) +++ branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 15246) @@ -1,6 +1,6 @@ Application->siteDomainField('DomainId'); + WHERE Hash = ' . kUtil::crc32($url) . ' AND DomainId = ' . (int)$this->Application->siteDomainField('DomainId'); $data = $this->Conn->GetRow($sql); if ($data) { @@ -261,7 +261,7 @@ $fields_hash = Array ( 'Url' => $url, - 'Hash' => crc32($url), + 'Hash' => kUtil::crc32($url), 'DomainId' => (int)$this->Application->siteDomainField('DomainId'), 'Prefixes' => $prefixes ? '|' . implode('|', $prefixes) . '|' : '', 'ParsedVars' => serialize($data), Index: branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php =================================================================== diff -u -N -r15241 -r15246 --- branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php (.../cat_dbitem_export_helper.php) (revision 15241) +++ branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php (.../cat_dbitem_export_helper.php) (revision 15246) @@ -1,6 +1,6 @@ Conn->qstr($cache_type).',%s,%s),'; + $fields_hash = Array ('CacheName' => $cache_type); $cache = getArrayValue($this->cacheStatus, $cache_type); - if (!$cache) $cache = Array(); - foreach ($cache as $var_name => $cache_status) { - $var_value = $this->cache[$cache_type][$var_name]; - $values_sql .= sprintf($sql_mask, $this->Conn->qstr($var_name), $this->Conn->qstr($var_value) ); + + if ( !$cache ) { + $cache = Array (); } - } - $values_sql = substr($values_sql, 0, -1); + foreach ($cache as $var_name => $cache_status) { + $fields_hash['VarName'] = $var_name; + $fields_hash['VarValue'] = $this->cache[$cache_type][$var_name]; - if ($values_sql) { - $sql = 'INSERT INTO '.$this->cacheTable.'(`CacheName`,`VarName`,`VarValue`) VALUES '.$values_sql; - $this->Conn->Query($sql); + $this->Conn->doInsert($fields_hash, $this->cacheTable, 'INSERT', false); + } } + if ( isset($fields_hash['VarName']) ) { + $this->Conn->doInsert($fields_hash, $this->cacheTable, 'INSERT'); + } } function loadCache() { - $sql = 'SELECT * FROM '.$this->cacheTable; - $records = $this->Conn->Query($sql); + $this->cache = Array (); - $this->cache = Array(); + $sql = 'SELECT * + FROM ' . $this->cacheTable; + $records = $this->Conn->GetIterator($sql); + foreach ($records as $record) { $this->addToCache($record['CacheName'], $record['VarName'], $record['VarValue'], false); } @@ -815,7 +819,7 @@ foreach ($this->curItem->CategoryPath as $category_index => $category_name) { if (!$category_name) continue; - $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); + $category_key = kUtil::crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); $category_id = $this->getFromCache('category_names', $category_key); if ($category_id === false) { @@ -915,7 +919,7 @@ } $where_clause = substr($where_clause, 0, -5); - $item_id = $this->getFromCache('new_ids', crc32($where_clause)); + $item_id = $this->getFromCache('new_ids', kUtil::crc32($where_clause)); if (!$item_id) { if ($this->exportOptions['CheckDuplicatesMethod'] == 2) { // by other fields @@ -963,7 +967,7 @@ if ($load_keys && ($save_method == 'Create') && $this->exportOptions['ReplaceDuplicates']) { // map new id to old id - $this->addToCache('new_ids', crc32($where_clause), $this->curItem->GetID() ); + $this->addToCache('new_ids', kUtil::crc32($where_clause), $this->curItem->GetID() ); } // assign item to categories Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r15239 -r15246 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15239) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15246) @@ -1,6 +1,6 @@