diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-05-22 01:13:44 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-05-22 01:13:44 +1000 |
| commit | 41c2b29a5565f34d5a52080061401dfd4888ab92 (patch) | |
| tree | a58fe8a084cb3e5b0c5b762b243536ffd593fffb | |
| parent | 0137b9646469ef8b4d8d38733da8d48b9d405164 (diff) | |
PURGE after the file has been written to, not before.
| -rw-r--r-- | inc/functions.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/inc/functions.php b/inc/functions.php index ec49dfbf..a55a9727 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -252,15 +252,6 @@ return; } - if(isset($config['purge']) && isset($_SERVER['HTTP_HOST'])) { - // Purge cache - if(basename($path) == $config['file_index']) { - // Index file (/index.html); purge "/" as well - purge(dirname($path) . '/'); - } - purge($path); - } - if(!$fp = fopen($path, 'c')) error('Unable to open file for writing: ' . $path); @@ -276,6 +267,15 @@ flock($fp, LOCK_UN); fclose($fp); + + if(isset($config['purge']) && isset($_SERVER['HTTP_HOST'])) { + // Purge cache + if(basename($path) == $config['file_index']) { + // Index file (/index.html); purge "/" as well + purge(dirname($path) . '/'); + } + purge($path); + } } function listBoards() { |
