? boost-337435.patch
Index: boost.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.admin.inc,v
retrieving revision 1.1.2.1.2.3.2.11
diff -u -p -r1.1.2.1.2.3.2.11 boost.admin.inc
--- boost.admin.inc	6 Apr 2009 20:59:50 -0000	1.1.2.1.2.3.2.11
+++ boost.admin.inc	29 Apr 2009 03:51:23 -0000
@@ -112,6 +112,12 @@ function boost_admin_settings($form = ar
     '#maxlength'     => 255,
     '#description'   => t('If you are synchronizing the generated static cache files to an external server through some means such as SFTP or rsync, you can enter a shell command to be executed following a successful cron-triggered cache update. Note that this is an advanced setting that should normally be left blank.'),
   );*/
+  $form['advanced']['boost_only_ascii_path'] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Only allow ASCII characters in path'),
+    '#default_value' => BOOST_ONLY_ASCII_PATH,
+    '#description'   => t('Only allowing ACSII characters is a safe way to cache pages. It severely limits i18n support so this can be turned off. Fair warning, disabling this may cause "page not found" errors depending on your url structure (spaces are bad, ect...). If you follow RFC 3986 you should be ok.'),
+  );
 
   return $form;
 }
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.29
diff -u -p -r1.3.2.2.2.5.2.29 boost.module
--- boost.module	22 Apr 2009 06:43:13 -0000	1.3.2.2.2.5.2.29
+++ boost.module	29 Apr 2009 03:51:23 -0000
@@ -20,6 +20,8 @@ define('BOOST_FETCH_METHOD',         var
 define('BOOST_PRE_PROCESS_FUNCTION', variable_get('boost_pre_process_function', ''));
 define('BOOST_POST_UPDATE_COMMAND',  variable_get('boost_post_update_command', ''));
 define('BOOST_CRON_LIMIT',           variable_get('boost_cron_limit', 100));
+define('BOOST_ONLY_ASCII_PATH',      variable_get('boost_only_ascii_path', TRUE));
 
 // This cookie is set for all authenticated users, so that they can be
 // excluded from caching (or in the future get a user-specific cached page):
@@ -554,8 +556,12 @@ function boost_file_path($path) {
     return FALSE;
   }
 
-  // Convert any other undesirable characters in the path to underscores:
-  $path = preg_replace('@[^/a-z0-9_\-&=,\.:]@i', '_', $path);
+  // Don't cache path if it can't be served by apache.
+  if (BOOST_ONLY_ASCII_PATH) {
+    if (preg_match('@[^/a-z0-9_\-&=,\.:]@i', $path)) {
+      return FALSE;
+    }
+  }
 
   return implode('/', array(BOOST_FILE_PATH, $path . BOOST_FILE_EXTENSION));
 }
