aboutsummaryrefslogtreecommitdiff
path: root/engine/handlers
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-06-22 20:19:53 -0400
committerSteve Clay <steve@mrclay.org>2013-06-22 20:19:53 -0400
commitc9d1dd21d3dcf7353570d555c21a2b6ca7ecdd00 (patch)
tree85fbd4f1bc98f16591480c9a8df65d8c1f99d008 /engine/handlers
parentd8b56850e79729cfaf2e5f85b882cf3c628a3ace (diff)
downloadelgg-c9d1dd21d3dcf7353570d555c21a2b6ca7ecdd00.tar.gz
elgg-c9d1dd21d3dcf7353570d555c21a2b6ca7ecdd00.tar.bz2
Fixes #5673: Properly check simplecache views list if cache file missing
Diffstat (limited to 'engine/handlers')
-rw-r--r--engine/handlers/cache_handler.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/engine/handlers/cache_handler.php b/engine/handlers/cache_handler.php
index 9848d3531..36fc665bb 100644
--- a/engine/handlers/cache_handler.php
+++ b/engine/handlers/cache_handler.php
@@ -88,20 +88,18 @@ header("ETag: \"$etag\"");
$filename = $dataroot . 'views_simplecache/' . md5($viewtype . $view);
if (file_exists($filename)) {
- $contents = file_get_contents($filename);
+ readfile($filename);
} else {
// someone trying to access a non-cached file or a race condition with cache flushing
mysql_close($mysql_dblink);
require_once(dirname(dirname(__FILE__)) . "/start.php");
global $CONFIG;
- if (!isset($CONFIG->views->simplecache[$view])) {
+ if (!in_array($view, $CONFIG->views->simplecache)) {
header("HTTP/1.1 404 Not Found");
exit;
}
elgg_set_viewtype($viewtype);
- $contents = elgg_view($view);
+ echo elgg_view($view);
}
-
-echo $contents;