1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-29 09:44:28 +01:00

bug fix for writing to root "/"

This commit is contained in:
Savetheinternet 2011-05-22 01:31:29 +10:00
parent 557bfbbd14
commit 57782fe512

View File

@ -222,7 +222,6 @@
global $config;
$uri = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/') . $uri;
foreach($config['purge'] as &$purge) {
$host = $purge[0];
$port = $purge[1];
@ -274,7 +273,13 @@
// Purge cache
if(basename($path) == $config['file_index']) {
// Index file (/index.html); purge "/" as well
purge(dirname($path) . '/');
$uri = dirname($path);
// root
if($uri == '.')
$uri = '';
else
$uri .= '/';
purge($uri);
}
purge($path);
}