summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Bendiken2006-11-27 16:34:49 (GMT)
committerArto Bendiken2006-11-27 16:34:49 (GMT)
commit4bd5b5497ca640dd64c0463aa64b2f29a15f684c (patch)
tree91dfc8194c7ef9616b12acba19cf43f908f3a093
parent739e00227cf0993029aa218bcfb4454054ba1ee4 (diff)
Added sanity checks to avoid trying to cache the front page contents on a cron run (fixes #99834).
-rw-r--r--boost.module8
1 files changed, 7 insertions, 1 deletions
diff --git a/boost.module b/boost.module
index 68998ce..64d07ac 100644
--- a/boost.module
+++ b/boost.module
@@ -85,6 +85,10 @@ function boost_menu($may_cache) {
* Implementation of hook_init(). Performs page setup tasks.
*/
function boost_init() {
+ // Stop right here unless we're being called for an ordinary page request
+ if (strpos($_SERVER['PHP_SELF'], 'index.php') === FALSE)
+ return;
+
// TODO: check interaction with other modules that use ob_start(); this
// may have to be moved to an earlier stage of the page request.
if (!variable_get('cache', CACHE_DISABLED) && BOOST_ENABLED) {
@@ -279,7 +283,9 @@ 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') {
- boost_cache_set($_GET['q'], $buffer);
+ if (strlen($buffer) > 0) { // Sanity check
+ boost_cache_set($_GET['q'], $buffer);
+ }
}
// Allow the page request to finish up normally