diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 21:55:57 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 21:55:57 +0000 |
commit | 12957adbf82d5c306366d4154b78dd063bbbac5c (patch) | |
tree | 1b278b4a473a46da6d0b315e071962a3e2877f61 /modules | |
parent | c48188aab044139727641f2ef6e66b6f00b9c6c9 (diff) | |
download | brdo-12957adbf82d5c306366d4154b78dd063bbbac5c.tar.gz brdo-12957adbf82d5c306366d4154b78dd063bbbac5c.tar.bz2 |
#194351 by David Strauss, JirkaRybka: (performance) pass on cache id information to filters
Diffstat (limited to 'modules')
-rw-r--r-- | modules/filter/filter.module | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/filter/filter.module b/modules/filter/filter.module index c2e310f3a..3a2fa4723 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -412,8 +412,8 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { $format = filter_resolve_format($format); // Check for a cached version of this piece of text. - $id = $format .':'. md5($text); - if ($cached = cache_get($id, 'cache_filter')) { + $cache_id = $format .':'. md5($text); + if ($cached = cache_get($cache_id, 'cache_filter')) { return $cached->data; } @@ -429,17 +429,17 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) { // Give filters the chance to escape HTML-like data such as code or formulas. foreach ($filters as $filter) { - $text = module_invoke($filter->module, 'filter', 'prepare', $filter->delta, $format, $text); + $text = module_invoke($filter->module, 'filter', 'prepare', $filter->delta, $format, $text, $cache_id); } // Perform filtering. foreach ($filters as $filter) { - $text = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $text); + $text = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $text, $cache_id); } // Store in cache with a minimum expiration time of 1 day. if ($cache) { - cache_set($id, $text, 'cache_filter', time() + (60 * 60 * 24)); + cache_set($cache_id, $text, 'cache_filter', time() + (60 * 60 * 24)); } } else { |