diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-29 18:08:28 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-29 18:08:28 +0000 |
commit | 0085972f1e62162b9c010237e5bd5b9b3bfccc4a (patch) | |
tree | 06e158fc0a7339996e16ad62025c7e810923a6c5 /includes/module.inc | |
parent | 8f1ec56d35004b188b176a85c89aee6db29cdc55 (diff) | |
download | brdo-0085972f1e62162b9c010237e5bd5b9b3bfccc4a.tar.gz brdo-0085972f1e62162b9c010237e5bd5b9b3bfccc4a.tar.bz2 |
#557542 follow-up by catch: Fixed module_implements() caching for authenticated users.
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/module.inc b/includes/module.inc index 1b6d04cf7..43bd83e1d 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -416,12 +416,10 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { */ function module_implements_write_cache() { $implementations = &drupal_static('module_implements'); - // Check whether we need to write the cache. We do not want to cache hooks, - // which are only invoked on HTTP POST requests. Maybe the page is not - // cacheable for other reasons than the HTTP request type as well, but this - // does not matter for the hook implementation cache, because nothing breaks - // if hook implementations are not cached. - if (isset($implementations['#write_cache']) && drupal_page_is_cacheable()) { + // Check whether we need to write the cache. We do not want to cache hooks + // which are only invoked on HTTP POST requests since these do not need to be + // optimized as tightly, and not doing so keeps the cache entry smaller. + if (isset($implementations['#write_cache']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD')) { unset($implementations['#write_cache']); cache_set('module_implements', $implementations); } |