summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Bendiken2007-09-21 12:50:08 (GMT)
committerArto Bendiken2007-09-21 12:50:08 (GMT)
commit8a727dd31c551460b1f8aef70fd51d95291bf3c7 (patch)
treee3d9c9993a3dca892d546a1fdfa0c450d17542bb
parentdeec3b5acc4693e4a4d8aefaee6987c698b36a5c (diff)
Corrected handling of 403/404 errors in relation to cached file creation (kudos to Barry Jaspan for the patch).
-rw-r--r--boost.module10
1 files changed, 8 insertions, 2 deletions
diff --git a/boost.module b/boost.module
index dee29c4..e343607 100644
--- a/boost.module
+++ b/boost.module
@@ -106,8 +106,14 @@ function boost_init() {
if (empty($user->uid) && $_SERVER['REQUEST_METHOD'] == 'GET') {
// Make sure no query string (in addition to ?q=) was set, and that
// the page is cacheable according to our current configuration:
- if (count($_GET) == 1 && boost_is_cacheable($_GET['q']))
+ if (count($_GET) == 1 && boost_is_cacheable($_GET['q'])) {
+ // In the event of errors such as drupal_not_found(), GET['q'] is
+ // changed before _boost_ob_handler() is called. Apache is going to
+ // look in the cache for the original path, however, so we need to
+ // preserve it.
+ $GLOBALS['_boost_path'] = $_GET['q'];
ob_start('_boost_ob_handler');
+ }
}
}
@@ -296,7 +302,7 @@ function _boost_ob_handler($buffer) {
// Check the currently set content type; at present we can't deal with anything else than HTML.
if (_boost_get_content_type() == 'text/html') {
if (strlen($buffer) > 0) { // Sanity check
- boost_cache_set($_GET['q'], $buffer);
+ boost_cache_set($GLOBALS['_boost_path'], $buffer);
}
}