I have a site which have url aliases like "names/inames.php" for compatibility with old urls.

Boost is creating wrong file names for such urls. (eg. inames_php.html)
it is replacing (.) dot with (_) underscore. So that static cache is not working for such urls.

Regards,

Asif

Comments

vivekkhera’s picture

Version: 5.x-1.x-dev » 5.x-1.0
Category: support » bug

I have the same issue with old URLs. I thought about convincing mod_rewrite to do the same "safe" filename conversion as boost does, but it was easier to patch boost:

Index: boost.api.inc
===================================================================
--- boost.api.inc	(revision 179)
+++ boost.api.inc	(working copy)
@@ -185,7 +185,7 @@
   }
 
   // Convert any other undesirable characters in the path to underscores
-  $path = preg_replace('@[^/a-z0-9_-]@i', '_', $path);
+  $path = preg_replace('@[^/a-z0-9\._-]@i', '_', $path);
 
   return boost_cache_directory() . '/' . $path . BOOST_FILE_EXTENSION;
 }

to leave the "." alone.

I believe this to be safe since boost already disallows ".." in the file path name.

asak’s picture

Could this method be used to have paths allow "%" chars as well? Or will it brake the code/system?

mikeytown2’s picture

Status: Active » Closed (fixed)

Closing all 5.x issues; will only reevaluate if someone steps up #454652: Looking for a co-maintainer - 5.x

Reason is 6.x has 10x as many users as 5.x; also last 5.x dev was over a year ago. The 5.x issue queue needs to go.