diff options
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index a55a9727..de483340 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -221,11 +221,13 @@ function purge($uri) { global $config; $uri = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/') . $uri; - $request = "PURGE {$uri} HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\nUser-Agent: Tinyboard\r\nConnection: Close\r\n\r\n"; + foreach($config['purge'] as &$purge) { $host = $purge[0]; $port = $purge[1]; + $http_host = isset($purge[2]) ? $purge[2] : $_SERVER['HTTP_HOST']; + $request = "PURGE {$uri} HTTP/1.0\r\nHost: {$http_host}\r\nUser-Agent: Tinyboard\r\nConnection: Close\r\n\r\n"; if($fp = fsockopen($host, $port, $errno, $errstr, $config['purge_timeout'])) { fwrite($fp, $request); fclose($fp); |
