summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Bendiken2006-12-06 20:12:52 (GMT)
committerArto Bendiken2006-12-06 20:12:52 (GMT)
commit1ff8e62b359c5e16792265953a00d92ab4c72a60 (patch)
treeb4763efd63346eb3c095769842c975a0cd4ef9e5
parent124259b9103dbf5a15c7c0d860cf4a6db30dfc95 (diff)
Merged latest bug fixes from HEAD.
-rw-r--r--boost.module5
-rw-r--r--htaccess/boosted.txt10
2 files changed, 9 insertions, 6 deletions
diff --git a/boost.module b/boost.module
index 64d07ac..4831921 100644
--- a/boost.module
+++ b/boost.module
@@ -92,9 +92,12 @@ function boost_init() {
// 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) {
+ // We only support GET requests by anonymous visitors:
global $user;
if (empty($user->uid) && $_SERVER['REQUEST_METHOD'] == 'GET') {
- if (boost_is_cacheable($_GET['q']))
+ // 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']))
ob_start('_boost_ob_handler');
}
}
diff --git a/htaccess/boosted.txt b/htaccess/boosted.txt
index 1e719e3..f89b084 100644
--- a/htaccess/boosted.txt
+++ b/htaccess/boosted.txt
@@ -90,17 +90,17 @@ DirectoryIndex index.php
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
- RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI} -d
- RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI}/index.html -f
- RewriteRule ^(.*)$ cache/%{HTTP_HOST}/0/$1/index.html [L]
+ RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI} -d
+ RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}/index.html -f
+ RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1/index.html [L]
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/user/login
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
- RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI}.html -f
- RewriteRule ^(.*)$ cache/%{HTTP_HOST}/0/$1.html [L]
+ RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}.html -f
+ RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1.html [L]
# BOOST END
# Rewrite current-style URLs of the form 'index.php?q=x'.