]> git.mxchange.org Git - friendica.git/commitdiff
clear_cache() check if cache dir is writable before opening it
authorFabrixxm <fabrix.xm@gmail.com>
Mon, 21 Oct 2013 18:03:01 +0000 (14:03 -0400)
committerFabrixxm <fabrix.xm@gmail.com>
Mon, 21 Oct 2013 18:03:01 +0000 (14:03 -0400)
boot.php

index 57414e8fcf933a7dfa28ebf303d808dd6fa137dc..2b58d805a5a74b36d9c53d347e4f5c3078cbb03b 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2156,6 +2156,7 @@ function clear_cache($basepath = "", $path = "") {
        if ($cachetime == 0)
                $cachetime = 86400;
 
+       if (is_writable($path)){
        if ($dh = opendir($path)) {
                while (($file = readdir($dh)) !== false) {
                        $fullpath = $path."/".$file;
@@ -2166,6 +2167,7 @@ function clear_cache($basepath = "", $path = "") {
                }
                closedir($dh);
        }
+       }
 }
 
 function set_template_engine(&$a, $engine = 'internal') {