mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Loosened character replacement in static-main.php, to allow for multibyte paths (see URLSegmentFilter::$default_allow_multibyte)
This commit is contained in:
parent
41b51a17ce
commit
18dbdd2df9
@ -83,9 +83,11 @@ if (
|
|||||||
$file = isset($homepageMap[$_SERVER['HTTP_HOST']]) ? $homepageMap[$_SERVER['HTTP_HOST']] : $file;
|
$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)
|
// Find file by extension (either *.html or *.php)
|
||||||
$file = preg_replace('/[^a-zA-Z0-9\/\-_]/si', '-', $file);
|
|
||||||
|
|
||||||
if (file_exists($cacheBaseDir . $cacheDir . $file . '.html')) {
|
if (file_exists($cacheBaseDir . $cacheDir . $file . '.html')) {
|
||||||
header('X-SilverStripe-Cache: hit at '.@date('r'));
|
header('X-SilverStripe-Cache: hit at '.@date('r'));
|
||||||
echo file_get_contents($cacheBaseDir . $cacheDir . $file . '.html');
|
echo file_get_contents($cacheBaseDir . $cacheDir . $file . '.html');
|
||||||
|
Loading…
Reference in New Issue
Block a user