RDF cache garbage collector does no longer kill MXChange cache files
[mailer.git] / inc / rdf.class.php
index 350976fde67b23b6b3cab9bb9b5c021b46dc4706..beaf027feb99179938c2f5aec14eabba8e503833 100644 (file)
@@ -1205,8 +1205,8 @@ class fase4_rdf {
         if (rand(1, 100) <= $this->gc_probability) {
             $dir = dir($this->_cache_dir);
             while($file=$dir->read()) {
-                if($file!="." AND $file!=".." AND filemtime($dir->path.$file) <= time() - $this->_refresh )  {
-                @unlink($dir->path.$file);
+                if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && filemtime($dir->path.$file) <= time() - $this->_refresh )  {
+                       @unlink($dir->path.$file);
                 }
         }
         $dir->close();