Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Loosened character replacement in static-main.php, to allow fo…

…r multibyte paths (see URLSegmentFilter::$default_allow_multibyte)
  • Loading branch information...
commit 18dbdd2df9f1fa5628daad40e8fb255aec2a1cba 1 parent 41b51a1
Ingo Schommer chillu authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 static-main.php
6 static-main.php
View
@@ -83,9 +83,11 @@
$file = isset($homepageMap[$_SERVER['HTTP_HOST']]) ? $homepageMap[$_SERVER['HTTP_HOST']] : $file;
}
+ // Encode each part of the path individually, in order to support multibyte paths.
+ // SiteTree.URLSegment and hence the static folder and filenames are stored in encoded form,
+ // to avoid filesystem incompatibilities.
+ $file = implode('/', array_map('rawurlencode', explode('/', $file)));
// Find file by extension (either *.html or *.php)
- $file = preg_replace('/[^a-zA-Z0-9\/\-_]/si', '-', $file);
-
if (file_exists($cacheBaseDir . $cacheDir . $file . '.html')) {
header('X-SilverStripe-Cache: hit at '.@date('r'));
echo file_get_contents($cacheBaseDir . $cacheDir . $file . '.html');
Please sign in to comment.
Something went wrong with that request. Please try again.