Changeset 1872


Ignore:
Timestamp:
06/05/10 01:16:17 (3 years ago)
Author:
shibuya246
Message:

[Branch 1.3] check for file exists before deleting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/libs/Maintenance.php

    r1871 r1872  
    133133                $success = false; 
    134134                while (($file = readdir($handle))!==false) { 
    135                         if ($file != 'placeholder.txt') { 
     135                    if (is_file($dir.'/'.$file)) { 
     136                        if ($file != 'placeholder.txt') {  
    136137                                if (@unlink($dir.'/'.$file)) { 
    137138                                        // ignore setting $success for the JavascriptConstants file which is ALWAYS present (even gets regenerated after deletion) 
     
    141142                                } 
    142143                        } 
     144                    } 
    143145                } 
    144146                closedir($handle); 
    145  
    146147                return $success; 
    147148        } 
Note: See TracChangeset for help on using the changeset viewer.