mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-29 09:44:28 +01:00
fix Varnish compatibility when characters such as * are in use for a boardname
This commit is contained in:
parent
3e95f7fc15
commit
769db5e784
@ -388,9 +388,12 @@ function purge($uri) {
|
|||||||
global $config, $debug;
|
global $config, $debug;
|
||||||
|
|
||||||
// Fix for Unicode
|
// Fix for Unicode
|
||||||
$uri = urlencode($uri);
|
$uri = rawurlencode($uri);
|
||||||
$uri = str_replace("%2F", "/", $uri);
|
|
||||||
$uri = str_replace("%3A", ":", $uri);
|
$noescape = "/!~*()+:";
|
||||||
|
$noescape = preg_split('//', $noescape);
|
||||||
|
$noescape_url = array_map("rawurlencode", $noescape);
|
||||||
|
$uri = str_replace($noescape_url, $noescape, $uri);
|
||||||
|
|
||||||
if (preg_match($config['referer_match'], $config['root']) && isset($_SERVER['REQUEST_URI'])) {
|
if (preg_match($config['referer_match'], $config['root']) && isset($_SERVER['REQUEST_URI'])) {
|
||||||
$uri = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/') . $uri;
|
$uri = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/') . $uri;
|
||||||
|
Loading…
Reference in New Issue
Block a user