]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
closes #1244 - checking whether file exists before deleting it in cache
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 10 Dec 2009 12:13:38 +0000 (12:13 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 10 Dec 2009 12:13:38 +0000 (12:13 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3752 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/cache.php

index fd13bf3c77f2e4914bb96dc7e76a0949bf9ae51f..df7b1e5254c5d811e51d5d409f13ca316f08df94 100644 (file)
@@ -389,8 +389,11 @@ class ElggFileCache extends ElggCache {
         */
        public function delete($key) {
                $dir = $this->get_variable("cache_path");
-
-               return unlink($dir.$key);
+               
+               if (file_exists($dir.$key)) {
+                       return unlink($dir.$key);
+               }
+               return TRUE;
        }
 
        public function clear() {