Commit 6d8deafd authored by Vincent Pelletier's avatar Vincent Pelletier

As we return cached version of those values, copy them upon return. This...

As we return cached version of those values, copy them upon return. This prevents third-party code from "poisoning" the cache.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24917 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8747b3c5
......@@ -887,7 +887,7 @@ class Catalog(Folder,
keys = keys.keys()
keys.sort()
return keys
return CachingMethod(_getColumnIds, id='SQLCatalog.getColumnIds', cache_factory='erp5_content_long')()
return CachingMethod(_getColumnIds, id='SQLCatalog.getColumnIds', cache_factory='erp5_content_long')().copy()
def getColumnMap(self):
"""
......@@ -906,7 +906,7 @@ class Catalog(Folder,
if not keys.has_key(key): keys[key] = []
keys[key].append(table) # Is this inconsistent ?
return keys
return CachingMethod(_getColumnMap, id='SQLCatalog.getColumnMap', cache_factory='erp5_content_long')()
return CachingMethod(_getColumnMap, id='SQLCatalog.getColumnMap', cache_factory='erp5_content_long')().copy()
def getResultColumnIds(self):
"""
......@@ -1708,7 +1708,7 @@ class Catalog(Folder,
%(table_index, table))
return table_index
return CachingMethod(_getTableIndex, id='SQLCatalog.getTableIndex', \
cache_factory='erp5_content_long')(table=table)
cache_factory='erp5_content_long')(table=table)[:]
def getIndex(self, table, column_list, all_column_list):
......@@ -1742,7 +1742,7 @@ class Catalog(Folder,
%(possible_index, table, column_list))
return possible_index
return CachingMethod(_getIndex, id='SQLCatalog.getIndex', cache_factory='erp5_content_long')\
(table=table, column_list=column_list, all_column_list=all_column_list)
(table=table, column_list=column_list, all_column_list=all_column_list)[:]
def buildSQLQuery(self, query_table='catalog', REQUEST=None,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment