? boost-620648.1.patch
? boost-620648.patch
Index: boost.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.install,v
retrieving revision 1.2.2.1.2.3.2.69
diff -u -p -r1.2.2.1.2.3.2.69 boost.install
--- boost.install	2 Nov 2009 10:56:42 -0000	1.2.2.1.2.3.2.69
+++ boost.install	2 Nov 2009 12:03:06 -0000
@@ -90,6 +90,8 @@ function boost_requirements($phase) {
         $crawler_response = drupal_http_request(BOOST_CRAWLER_SELF . '&test=1');
         $crawler_response = $crawler_response->code;
       }
+      $robots = file_exists('robots.txt') ? file_get_contents('robots.txt') : FALSE;
+
       foreach ($cache_directories as $cache_directory) {
         _boost_mkdir_p($cache_directory);
         $root_file = file_put_contents($cache_directory . '/' . variable_get('boost_root_file', '.boost'), $cache_directory);
@@ -220,6 +222,14 @@ function boost_requirements($phase) {
           'value'       => $t('File system sub directory limit.'),
         );
       }
+      if ($robots && !stristr($robots, 'Disallow: /boost_stats.php')) {
+        $requirements['boost_robots'] = array(
+          'title'       => $t('Boost'),
+          'description' => $t('Your robots.txt file does not contain "Disallow: /boost_stats.php". This is needed inorder to prevent the output of this from accendently getting indexed by search engines.'),
+          'severity'    => REQUIREMENT_WARNING,
+          'value'       => $t('"Disallow: /boost_stats.php" entry missing in robots.txt'),
+        );
+      }
       if (empty($requirements)) {
         $requirements['boost'] = array(
           'title'       => $t('Boost'),
Index: stats/boost_stats.ajax.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/stats/Attic/boost_stats.ajax.inc,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 boost_stats.ajax.inc
--- stats/boost_stats.ajax.inc	4 Oct 2009 07:18:41 -0000	1.1.2.6
+++ stats/boost_stats.ajax.inc	2 Nov 2009 12:03:06 -0000
@@ -10,18 +10,18 @@
  * AJAX Menu Callback.
  */
 function boost_stats_ajax_callback() {
-  if (!isset($_GET['js'])) {
-    // stats not called via JS, send image out & close connection.
-    boost_async_opp("\x47\x49\x46\x38\x39\x61\x1\x0\x1\x0\x80\xff\x0\xc0\xc0\xc0\x0\x0\x0\x21\xf9\x4\x1\x0\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b", TRUE, 'image/gif', 43);
-  }
-
   // Exit if nothing was passed to this.
   if (   !isset($_GET['nid'])
       && !isset($_GET['title'])
       && !isset($_GET['qq'])
       && !isset($_GET['referer'])
       ) {
-    exit;
+    return drupal_not_found();
+  }
+
+  if (!isset($_GET['js'])) {
+    // stats not called via JS, send image out & close connection.
+    boost_async_opp("\x47\x49\x46\x38\x39\x61\x1\x0\x1\x0\x80\xff\x0\xc0\xc0\xc0\x0\x0\x0\x21\xf9\x4\x1\x0\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b", TRUE, 'image/gif', 43);
   }
 
   // Set variables passed via GET.
@@ -68,7 +68,7 @@ function boost_stats_ajax_callback() {
 
       // Send JSON Back
       if (!empty($json)) {
-        echo drupal_json($json);
+        drupal_json($json);
       }
     }
     // Send HTML back
Index: stats/boost_stats.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/stats/Attic/boost_stats.php,v
retrieving revision 1.1.2.13
diff -u -p -r1.1.2.13 boost_stats.php
--- stats/boost_stats.php	21 Oct 2009 19:57:38 -0000	1.1.2.13
+++ stats/boost_stats.php	2 Nov 2009 12:03:06 -0000
@@ -6,20 +6,22 @@
  * Place in webroot, for faster stats if needed.
  */
 
-if (!isset($_GET['js'])) {
-  // stats not called via JS, send image out & close connection.
-  boost_stats_async_image();
-}
-
 // Exit script if nothing was passed to it.
 if (   !isset($_GET['nid'])
     && !isset($_GET['title'])
     && !isset($_GET['qq'])
     && !isset($_GET['referer'])
     ) {
+  boost_stats_full_boot();
+  drupal_not_found();
   exit;
 }
 
+if (!isset($_GET['js'])) {
+  // stats not called via JS, send image out & close connection.
+  boost_stats_async_image();
+}
+
 // connect to db & set variables.
 boost_stats_init();
 
@@ -41,8 +43,7 @@ if (isset($_GET['js'])) {
 
     // Send JSON Back
     if (!empty($json)) {
-      header('Content-Type: text/javascript; charset=utf-8');
-      echo json_encode($json);
+      drupal_json($json);
     }
   }
   // Send HTML back
